C# Class SIL.FieldWorks.Common.Widgets.InnerFwTextBox

InnerFwTextBox implements the main body of an FwTextBox. Has to be public so combo box can return its text box.
Inheritance: SIL.FieldWorks.Common.RootSites.SimpleRootSite, IVwNotifyChange, IWritingSystemAndStylesheet
Exibir arquivo Open project: sillsdev/FieldWorks Class Usage Examples

Private Properties

Property Type Description
AdjustHeight bool
BaseMakeSelectionVisible void
CreateTempWritingSystemFactory void
RemoveNonRootNotifications void
ReplaceAll ITsString
RestoreNonRootNotifications void
ShutDownTempWsFactory void
SubstringCount int

Public Methods

Method Description
ApplyWS ( int hvoWs ) : void

Applies the specified writing system to the current selection

GetAvailWidth ( IVwRootBox prootb ) : int

Simulate infinite width if needed.

InnerFwTextBox ( ) : System

Default constructor

MakeRoot ( ) : void

Create the root box and initialize it. We want this one to work even in design mode, and since we supply the cache and data ourselves, that's possible.

PropChanged ( int hvo, int tag, int ivMin, int cvIns, int cvDel ) : void

Any change to this private data access must be a change to our string, so check its length.

Select ( int start, int length ) : void

Selects a range of text in the text box.

If you want to set the start position to the first character in the control's text, set the start parameter to 0. You can use this method to select a substring of text, such as when searching through the text of the control and replacing information. Note: You can programmatically move the caret within the text box by setting the start parameter to the position within the text box where you want the caret to move to and set the length parameter to a value of zero (0). The text box must have focus in order for the caret to be moved.

Protected Methods

Method Description
CreateEditingHelper ( ) : EditingHelper

Creates a special extended editing helper for this text box.

Dispose ( bool disposing ) : void

Clean up any resources being used.

ExtToIntIndex ( int extIndex ) : int

Converts the external string index to the internal string index. They might be different because a line break character is used internally to represent a new line and CRLF is used externally on Windows to represent a new line.

IntToExtIndex ( int intIndex ) : int

Converts the internal string index to the external string index. They might be different because a line break character is used internally to represent a new line and CRLF is used externally on Windows to represent a new line.

MakeSelectionVisible ( IVwSelection sel, bool fWantOneLineSpace ) : bool

First try to make everything visible, if possible. This is especially helpful with RTL text.

OnKeyDown ( KeyEventArgs e ) : void

watch for keys to do the cut/copy/paste operations

OnKeyPress ( KeyPressEventArgs e ) : void

Override to suppress Enter key if it is not allowed.

OnMouseMoveSetCursor ( Point mousePos ) : void

show default cursor for read-only text boxes.

OnSizeChanged ( EventArgs e ) : void

When the edit box gets resized, recalc the maximum line height (when setting a Tss string, applying styles, or setting the WS, we need to reduce the font size if necessary to keep the text from being clipped by the height of the box).

Private Methods

Method Description
AdjustHeight ( ) : bool

Adjusts text height after a style change.

BaseMakeSelectionVisible ( IVwSelection sel ) : void
CreateTempWritingSystemFactory ( ) : void

Make a writing system factory that is based on the Languages folder (ICU-based). This is only used in Designer, tests, and momentarily (during construction) in production, until the client sets supplies a real one.

RemoveNonRootNotifications ( ) : void
ReplaceAll ( ITsString tss, string oldSubStr, string newSubStr ) : ITsString
RestoreNonRootNotifications ( ) : void
ShutDownTempWsFactory ( ) : void

Shut down the writing system factory and release it explicitly.

SubstringCount ( string str, string substr ) : int

Method Details

ApplyWS() public method

Applies the specified writing system to the current selection
public ApplyWS ( int hvoWs ) : void
hvoWs int The ID of the writing system to apply
return void

CreateEditingHelper() protected method

Creates a special extended editing helper for this text box.
protected CreateEditingHelper ( ) : EditingHelper
return EditingHelper

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool
return void

ExtToIntIndex() protected method

Converts the external string index to the internal string index. They might be different because a line break character is used internally to represent a new line and CRLF is used externally on Windows to represent a new line.
protected ExtToIntIndex ( int extIndex ) : int
extIndex int The external string index.
return int

GetAvailWidth() public method

Simulate infinite width if needed.
public GetAvailWidth ( IVwRootBox prootb ) : int
prootb IVwRootBox
return int

InnerFwTextBox() public method

Default constructor
public InnerFwTextBox ( ) : System
return System

IntToExtIndex() protected method

Converts the internal string index to the external string index. They might be different because a line break character is used internally to represent a new line and CRLF is used externally on Windows to represent a new line.
protected IntToExtIndex ( int intIndex ) : int
intIndex int The internal string index.
return int

MakeRoot() public method

Create the root box and initialize it. We want this one to work even in design mode, and since we supply the cache and data ourselves, that's possible.
public MakeRoot ( ) : void
return void

MakeSelectionVisible() protected method

First try to make everything visible, if possible. This is especially helpful with RTL text.
protected MakeSelectionVisible ( IVwSelection sel, bool fWantOneLineSpace ) : bool
sel IVwSelection The sel.
fWantOneLineSpace bool if set to true [f want one line space].
return bool

OnKeyDown() protected method

watch for keys to do the cut/copy/paste operations
protected OnKeyDown ( KeyEventArgs e ) : void
e System.Windows.Forms.KeyEventArgs
return void

OnKeyPress() protected method

Override to suppress Enter key if it is not allowed.
protected OnKeyPress ( KeyPressEventArgs e ) : void
e System.Windows.Forms.KeyPressEventArgs
return void

OnMouseMoveSetCursor() protected method

show default cursor for read-only text boxes.
protected OnMouseMoveSetCursor ( Point mousePos ) : void
mousePos Point
return void

OnSizeChanged() protected method

When the edit box gets resized, recalc the maximum line height (when setting a Tss string, applying styles, or setting the WS, we need to reduce the font size if necessary to keep the text from being clipped by the height of the box).
protected OnSizeChanged ( EventArgs e ) : void
e System.EventArgs
return void

PropChanged() public method

Any change to this private data access must be a change to our string, so check its length.
public PropChanged ( int hvo, int tag, int ivMin, int cvIns, int cvDel ) : void
hvo int
tag int
ivMin int
cvIns int
cvDel int
return void

Select() public method

Selects a range of text in the text box.
If you want to set the start position to the first character in the control's text, set the start parameter to 0. You can use this method to select a substring of text, such as when searching through the text of the control and replacing information. Note: You can programmatically move the caret within the text box by setting the start parameter to the position within the text box where you want the caret to move to and set the length parameter to a value of zero (0). The text box must have focus in order for the caret to be moved.
/// The value assigned to either the start parameter or the length parameter is less than zero. ///
public Select ( int start, int length ) : void
start int The position of the first character in the current text selection within the text box.
length int The number of characters to select.
return void