C# Class SIL.FieldWorks.FwCoreDlgs.ValidCharactersDlg

Dialog for specifying the valid characters for a FieldWorks writing system
Inheritance: System.Windows.Forms.Form
Show file Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Property Type Description
m_validCharsGridMngr ValidCharGridsManager

Private Properties

Property Type Description
AddExemplarChars void
AddRangeOfCharacters void
BasedOnRadioButton_CheckedChanged void
FillInventoryGrid void
HandleCharGridCharacterChanged void
HandleCharGridGotFocus void
HandleCharGridSelChange void
HandleCharTextBoxEnter void
HandleCharTextBoxLeave void
HandleCheckedChanged void
HandleTreatAsClick void
InitializeComponent void
InventoryCharCodeComparer int
InventoryCharComparer int
InventoryCountComparer int
InventoryIsValidComparer int
RemoveInvalidCharacters void
SortInventoryGrid void
UpdateTreatAsButtons void
ValidCharactersDlg System
VerifyCharInRange void
btnAddCharacters_Click void
btnBrowseLangFile_Click void
btnHelp_Click void
btnOk_Click void
btnRemoveAll_Click void
btnRemoveChar_Click void
btnSimilarWs_LocaleSelected void
contextCtrl_GetContextInfo void
contextCtrl_TextTokenSubStringsLoaded void
gridCharInventory_CellFormatting void
gridCharInventory_CellPainting void
gridCharInventory_CellValueNeeded void
gridCharInventory_CellValuePushed void
gridCharInventory_ColumnHeaderMouseClick void
rdoSimilarWs_TextChanged void
tabControlAddFrom_SelectedIndexChanged void
tabCtrlAddFrom_ClientSizeChanged void
txtFirstChar_TextChanged void
txtLanguageFile_Enter void
txtLastChar_TextChanged void
txtManualCharEntry_TextChanged void
txtUnicodeValue_KeyPress void
txtUnicodeValue_TextChanged void

Public Methods

Method Description
RunDialog ( FdoCache cache, IApp app, IWin32Window owner, IHelpTopicProvider helpTopicProvider ) : bool

Display the valid characters dialog box. Return true if OK was chosen.

ValidCharactersDlg ( ) : System

Initializes a new instance of the ValidCharactersDlg class.

Protected Methods

Method Description
AddSingleCharacter ( FwTextBox txt ) : void

Adds a single character to the list of valid characters.

CreateValidCharGridsManager ( ) : ValidCharGridsManager

Creates a new ValidCharGridsManager. This method is here so we can override it in tests.

Dispose ( bool disposing ) : void

Clean up any resources being used.

GetCharacterType ( string chr ) : ValidCharacterType

If the specified character is defined as a PUA character in m_langDef, returns its character type; otherwise, returns a value that indicates whether it is a valid character as defined by the Unicode Standard.

IssueBeep ( ) : void

Issues a warning beep when the user performs an illegal operation.

OnClosed ( EventArgs e ) : void

Raises the E:System.Windows.Forms.Form.Closed event.

OnClosing ( CancelEventArgs e ) : void

OnLoad ( EventArgs e ) : void

Handles the Load event of the ValidCharactersDlg control.

ShowMessageBox ( string message ) : void

Shows a message box to warn the user about an invalid operation.

Private Methods

Method Description
AddExemplarChars ( string IcuLocale ) : void

Try to retrieve a set of ValidChars (ExemplarCharacters) from ICU for the language associated with the IcuLocale parameter and add those to the valid characters grids.

AddRangeOfCharacters ( ) : void

Adds a range of characters to the valid characters list.

BasedOnRadioButton_CheckedChanged ( object sender, EventArgs e ) : void

Handles the CheckedChanged event of the radio button controls on the Based On tab.

FillInventoryGrid ( List tokenSubstrings ) : void

Fills the inventory grid.

HandleCharGridCharacterChanged ( SIL.FieldWorks.Common.Controls.CharacterGrid grid, string newCharacter ) : void

Event fired when the current character changes in one of the grids.

HandleCharGridGotFocus ( object sender, EventArgs e ) : void

Handles the event fired when one of the character grids gains focus.

HandleCharGridSelChange ( object sender, EventArgs e ) : void

Handles the event fired when one of the character grids gains focus.

HandleCharTextBoxEnter ( object sender, EventArgs e ) : void

Handles the Enter event of the txtManualCharEntry control.

HandleCharTextBoxLeave ( object sender, EventArgs e ) : void

Handles the Enter event of the txtManualCharEntry control.

HandleCheckedChanged ( object sender, EventArgs e ) : void

Handle selecting one of the options on the manual entry tab

HandleTreatAsClick ( object sender, EventArgs e ) : void

Handles the Click event of the btnTreatAsPunct control.

InitializeComponent ( ) : void
InventoryCharCodeComparer ( CharacterInventoryRow x, CharacterInventoryRow y ) : int

Compares character inventory rows on the character codes field.

InventoryCharComparer ( CharacterInventoryRow x, CharacterInventoryRow y ) : int

Compares character inventory rows on the character field.

InventoryCountComparer ( CharacterInventoryRow x, CharacterInventoryRow y ) : int

Compares character inventory rows on the count field.

InventoryIsValidComparer ( CharacterInventoryRow x, CharacterInventoryRow y ) : int

Compares character inventory rows on the IsValid field.

RemoveInvalidCharacters ( List list ) : void

Removes the invalid characters.

SortInventoryGrid ( ) : void

Sorts the inventory grid column that has the sort glyph.

UpdateTreatAsButtons ( ) : void

Updates the enabled state of the "treat as..." buttons.

ValidCharactersDlg ( FdoCache cache, IWritingSystemContainer wsContainer, IHelpTopicProvider helpTopicProvider, IApp app, IWritingSystem ws, string wsName ) : System
VerifyCharInRange ( FwTextBox textbox, Label lbl ) : void

Verifies the contents of the text box is a base character.

btnAddCharacters_Click ( object sender, EventArgs e ) : void

Handles the Click event of the btnAddCharacters control.

btnBrowseLangFile_Click ( object sender, EventArgs e ) : void

Handles the Click event of the btnBrowseLangFile control.

btnHelp_Click ( object sender, EventArgs e ) : void

Handles the Click event of the btnHelp control.

btnOk_Click ( object sender, EventArgs e ) : void

Handles the Click event of the btnOk control.

btnRemoveAll_Click ( object sender, EventArgs e ) : void

Handles the Click event of the btnRemoveAll control.

btnRemoveChar_Click ( object sender, EventArgs e ) : void

Handles the Click event of the btnRemoveChar control.

btnSimilarWs_LocaleSelected ( object sender, EventArgs e ) : void

When btnSimilarWs.LocaleSelected is set to None we need to diable Add button.

contextCtrl_GetContextInfo ( int index, string &sKey, string &sConcordanceItem ) : void

Gets the context info for the given row in the context control.

contextCtrl_TextTokenSubStringsLoaded ( List tokenSubstrings ) : void

gridCharInventory_CellFormatting ( object sender, DataGridViewCellFormattingEventArgs e ) : void
gridCharInventory_CellPainting ( object sender, DataGridViewCellPaintingEventArgs e ) : void

Get rid of the cell's focus rectangle.

gridCharInventory_CellValueNeeded ( object sender, DataGridViewCellValueEventArgs e ) : void

gridCharInventory_CellValuePushed ( object sender, DataGridViewCellValueEventArgs e ) : void

gridCharInventory_ColumnHeaderMouseClick ( object sender, DataGridViewCellMouseEventArgs e ) : void

Handles the ColumnHeaderMouseClick event of the gridCharInventory control.

rdoSimilarWs_TextChanged ( object sender, EventArgs e ) : void

Handles the TextChanged event of the rdoSimilarWs control.

tabControlAddFrom_SelectedIndexChanged ( object sender, EventArgs e ) : void

Sets the enabled state of the add button.

tabCtrlAddFrom_ClientSizeChanged ( object sender, EventArgs e ) : void

txtFirstChar_TextChanged ( object sender, EventArgs e ) : void

txtLanguageFile_Enter ( object sender, EventArgs e ) : void

Handles the Enter event of the txtLanguageFile control.

txtLastChar_TextChanged ( object sender, EventArgs e ) : void

txtManualCharEntry_TextChanged ( object sender, EventArgs e ) : void

Handles the TextChanged event of the txtManualCharEntry control.

txtUnicodeValue_KeyPress ( object sender, KeyPressEventArgs e ) : void

Make sure only hex digits are allowed in the txtUnicodeValue text box.

txtUnicodeValue_TextChanged ( object sender, EventArgs e ) : void

Handles the TextChanged event of the txtUnicodeValue control.

Method Details

AddSingleCharacter() protected method

Adds a single character to the list of valid characters.
protected AddSingleCharacter ( FwTextBox txt ) : void
txt FwTextBox
return void

CreateValidCharGridsManager() protected method

Creates a new ValidCharGridsManager. This method is here so we can override it in tests.
protected CreateValidCharGridsManager ( ) : ValidCharGridsManager
return ValidCharGridsManager

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void

GetCharacterType() protected method

If the specified character is defined as a PUA character in m_langDef, returns its character type; otherwise, returns a value that indicates whether it is a valid character as defined by the Unicode Standard.
protected GetCharacterType ( string chr ) : ValidCharacterType
chr string The character (may consist of more than one Unicode codepoint.
return ValidCharacterType

IssueBeep() protected method

Issues a warning beep when the user performs an illegal operation.
protected IssueBeep ( ) : void
return void

OnClosed() protected method

Raises the E:System.Windows.Forms.Form.Closed event.
protected OnClosed ( EventArgs e ) : void
e EventArgs The that contains the event data.
return void

OnClosing() protected method

protected OnClosing ( CancelEventArgs e ) : void
e CancelEventArgs
return void

OnLoad() protected method

Handles the Load event of the ValidCharactersDlg control.
protected OnLoad ( EventArgs e ) : void
e EventArgs
return void

RunDialog() public static method

Display the valid characters dialog box. Return true if OK was chosen.
public static RunDialog ( FdoCache cache, IApp app, IWin32Window owner, IHelpTopicProvider helpTopicProvider ) : bool
cache FdoCache
app IApp
owner IWin32Window
helpTopicProvider IHelpTopicProvider
return bool

ShowMessageBox() protected method

Shows a message box to warn the user about an invalid operation.
protected ShowMessageBox ( string message ) : void
message string The message for the user.
return void

ValidCharactersDlg() public method

Initializes a new instance of the ValidCharactersDlg class.
public ValidCharactersDlg ( ) : System
return System

Property Details

m_validCharsGridMngr protected property

Protected to facilitate testing
protected ValidCharGridsManager m_validCharsGridMngr
return ValidCharGridsManager