C# Class ACAT.Lib.Extension.AlphabetScannerCommon

This is a helper class exclusively for Alphabet scanners. It does a lot of the heavy lifting required for word predictions for instance. This eases coding for Alphabet scanners. Create an object of this type in the Alphabet scanner class
Inheritance: IDisposable
Show file Open project: brlima94/acat-localization Class Usage Examples

Public Methods

Method Description
AlphabetScannerCommon ( IScannerPanel scannerPanel ) : System

Constructor. Initialize the various controls and display the UI

CheckWidgetEnabled ( ACAT.Lib.Core.AgentManagement.CheckEnabledArgs arg ) : bool

Checks if the widget in arg needs to be enabled or not depending on the context. Call this in the CheckWidgetEnabled function in the Alphabet scanner.

Dispose ( ) : void

Call this in the Dispose() function of the Alphabet scanner

Initialize ( ACAT.Lib.Core.PanelManagement.StartupArg startupArg ) : bool

Call this in the Initialize function of the Alphabet scanner

OnClosing ( object sender, FormClosingEventArgs e ) : void

Release resources and stop threads/timers. Call this in the OnClosing() function in the Alphabet scanner.

OnFocusChanged ( ACAT.Lib.Core.Utility.WindowActivityMonitorInfo info ) : void

Invoked when the focus changes either in the active window or when the active window itself changes. Call this from the OnFocusChanged function in the Alphabet scanner

OnFormClosing ( FormClosingEventArgs e ) : void

Scanner is closing. Call this in the OnFormClosing function in the Alphabet scanner.

OnLoad ( object sender, EventArgs e ) : void

The form has loaded. Start the animation sequence. Call this from the OnLoad function in the Alphabet scanner

OnPause ( ) : void

Pause the application. Call this in the OnPause function in the Alphabet scanner.

OnResume ( ) : void

Resumes the application. Call this in the OnResume function in the Alphabet scanner.

OnWidgetActuated ( ACAT.Lib.Core.WidgetManagement.Widget widget, bool &handled ) : void

Triggered when a widget is actuated. Call this in the OnWidgetActuated function in the Alphabet scanner.

RestoreDefaults ( ) : void

Restores default size and position. Call this in the RestoreDefaults function in the Alphabet scanner.

SaveScaleSetting ( ) : void

Saves the current scale setting

SaveSettings ( ) : void

Saves current size/position settings. Call this in the SaveSettings function in the Alphabet scanner.

ScaleDefault ( ) : void

Sets the default scale factor

ScaleDown ( ) : void

Zooms out the scanner. Call this in the ScaleDown function in the Alphabet scanner.

ScaleUp ( ) : void

Zooms in the scanner. Call this in the ScaleUp function in the Alphabet scanner.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Disposer. Releases resources and cleanup.

Private Methods

Method Description
AppAgent_EvtTextChanged ( object sender, EventArgs e ) : void

Something changed in the output text window. Sest the word in the "CurrentWordWidget" box and do a fresh word prediction

KeyStateTracker_EvtKeyStateChanged ( ) : void

Some modifier key was pressed. Handled it.

WndProc ( Message &m ) : bool
contains ( IEnumerable list, int count, String word ) : bool

Checks if the word is in the list

formatWord ( int index, String word ) : String

Formats the prediction word with the index

refreshWordPredictionsAndSetCurrentWord ( ) : void

Fetch new set of words into the prediction list box

subscribeToEvents ( ) : void

Subscribes to all the events triggered by the widgets and the interpreter

subscribeToTalkManagerEvents ( ) : void

Subscribes to events triggered by the Output manager

tryRefreshWordPredictionsAndSetCurrentWord ( ) : bool

Refreshes the word prediction list and also updates the current word box with the word that is currently being typed.

Method Details

AlphabetScannerCommon() public method

Constructor. Initialize the various controls and display the UI
public AlphabetScannerCommon ( IScannerPanel scannerPanel ) : System
scannerPanel IScannerPanel
return System

CheckWidgetEnabled() public method

Checks if the widget in arg needs to be enabled or not depending on the context. Call this in the CheckWidgetEnabled function in the Alphabet scanner.
public CheckWidgetEnabled ( ACAT.Lib.Core.AgentManagement.CheckEnabledArgs arg ) : bool
arg ACAT.Lib.Core.AgentManagement.CheckEnabledArgs widget info
return bool

Dispose() public method

Call this in the Dispose() function of the Alphabet scanner
public Dispose ( ) : void
return void

Dispose() protected method

Disposer. Releases resources and cleanup.
protected Dispose ( bool disposing ) : void
disposing bool true to dispose managed resources
return void

Initialize() public method

Call this in the Initialize function of the Alphabet scanner
public Initialize ( ACAT.Lib.Core.PanelManagement.StartupArg startupArg ) : bool
startupArg ACAT.Lib.Core.PanelManagement.StartupArg startup arguments
return bool

OnClosing() public method

Release resources and stop threads/timers. Call this in the OnClosing() function in the Alphabet scanner.
public OnClosing ( object sender, FormClosingEventArgs e ) : void
sender object
e System.Windows.Forms.FormClosingEventArgs
return void

OnFocusChanged() public method

Invoked when the focus changes either in the active window or when the active window itself changes. Call this from the OnFocusChanged function in the Alphabet scanner
public OnFocusChanged ( ACAT.Lib.Core.Utility.WindowActivityMonitorInfo info ) : void
info ACAT.Lib.Core.Utility.WindowActivityMonitorInfo
return void

OnFormClosing() public method

Scanner is closing. Call this in the OnFormClosing function in the Alphabet scanner.
public OnFormClosing ( FormClosingEventArgs e ) : void
e System.Windows.Forms.FormClosingEventArgs event args
return void

OnLoad() public method

The form has loaded. Start the animation sequence. Call this from the OnLoad function in the Alphabet scanner
public OnLoad ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

OnPause() public method

Pause the application. Call this in the OnPause function in the Alphabet scanner.
public OnPause ( ) : void
return void

OnResume() public method

Resumes the application. Call this in the OnResume function in the Alphabet scanner.
public OnResume ( ) : void
return void

OnWidgetActuated() public method

Triggered when a widget is actuated. Call this in the OnWidgetActuated function in the Alphabet scanner.
public OnWidgetActuated ( ACAT.Lib.Core.WidgetManagement.Widget widget, bool &handled ) : void
widget ACAT.Lib.Core.WidgetManagement.Widget widget that was actuated
handled bool set to true if handled
return void

RestoreDefaults() public method

Restores default size and position. Call this in the RestoreDefaults function in the Alphabet scanner.
public RestoreDefaults ( ) : void
return void

SaveScaleSetting() public method

Saves the current scale setting
public SaveScaleSetting ( ) : void
return void

SaveSettings() public method

Saves current size/position settings. Call this in the SaveSettings function in the Alphabet scanner.
public SaveSettings ( ) : void
return void

ScaleDefault() public method

Sets the default scale factor
public ScaleDefault ( ) : void
return void

ScaleDown() public method

Zooms out the scanner. Call this in the ScaleDown function in the Alphabet scanner.
public ScaleDown ( ) : void
return void

ScaleUp() public method

Zooms in the scanner. Call this in the ScaleUp function in the Alphabet scanner.
public ScaleUp ( ) : void
return void