C# Class FlexFieldControlLib.FlexFieldControl

Inheritance: System.Windows.Forms.UserControl
Show file Open project: binaryage/xrefresh

Private Properties

Property Type Description
AdjustSize void
CalculateMinimumSize System.Drawing.Size
Cleanup void
GetSuggestedHeight int
GetTextMetrics NativeMethods.TEXTMETRIC
HandleMouseDown void
InitializeComponent void
InitializeControls void
IsValidFieldIndex bool
IsValidSeparatorIndex bool
LayoutControls void
OnFieldChanged void
OnFieldFocus void
OnFieldKeyPressed void
OnFieldSizeChanged void
OnFieldValidated void
OnFocusCeded void
OnSeparatorMouseEvent void
OnSeparatorSizeChanged void
Parse void

Public Methods

Method Description
AddCedeFocusKey ( int fieldIndex, KeyEventArgs e ) : bool

Adds a KeyEventArgs to a specific field that indicates when a field should cede focus to the next field in the control. By default, each field has a single cede focus key -- the [Space] key.

AddCedeFocusKey ( KeyEventArgs e ) : void

Adds a KeyEventArgs to every field that indicates when a field should cede focus to the next field in the control. By default, each field has a single cede focus key -- the [Space] key.

Clear ( ) : void

Clears all content from the fields in the control.

ClearCedeFocusKeys ( ) : void

Removes every cede focus key from every field in the control.

ClearCedeFocusKeys ( int fieldIndex ) : void

Removes every cede focus key from a specific field in the control.

GetCasing ( int fieldIndex ) : CharacterCasing

Gets the character casing for a field in the control.

GetFieldText ( int fieldIndex ) : string

Gets the text of a specific field in the control.

GetLeadingZeros ( int fieldIndex ) : bool

Gets whether a field that is not blank has leading zeros.

GetMaxLength ( int fieldIndex ) : int

Gets the maximum number of characters allowed in a specific field.

GetRangeHigh ( int fieldIndex ) : int

Gets the high inclusive boundary of allowed values for a specific field. The default value varies based on ValueFormat and MaxLength, but it is always the maximum value that can be represented by the field.

GetRangeLow ( int fieldIndex ) : int

Gets the low inclusive boundary of allowed values for a specific field. Default value is 0.

GetSeparatorText ( int separatorIndex ) : string

Gets the text for a specific separator in the control.

GetValue ( int fieldIndex ) : int

Gets the value of a specific field. If the field is blank, its value is the same as its low range value.

GetValueFormat ( int fieldIndex ) : ValueFormat

Gets the value format for a specific field in the control.

HasFocus ( int fieldIndex ) : bool

Determines if a specific field has input focus. True indicates that the field has focus.

IsBlank ( int fieldIndex ) : bool

Determines if every field in the control is blank. True indicates that every field in the control is blank.

ResetCedeFocusKeys ( ) : void

Removes every cede focus key from every field, and adds the default cede focus key -- the [Space] key -- to every field.

ResetCedeFocusKeys ( int fieldIndex ) : void

Removes every cede focus key from a specific field, and adds the default cede focus key -- the [Space] key -- to the field.

SetCasing ( CharacterCasing casing ) : void

Sets the character casing for every field in the control.

SetCasing ( int fieldIndex, CharacterCasing casing ) : void

Sets the character casing for a specific field in the control.

SetFieldText ( int fieldIndex, string text ) : void

Sets text for a specific field in the control.

SetFieldText ( string text ) : void

Sets text for every field in the control.

SetFocus ( int fieldIndex ) : void

Sets input focus to a field in the control.

SetLeadingZeros ( bool leadingZeros ) : void

Toggles whether the value for every field is displayed with leading zeros.

SetLeadingZeros ( int fieldIndex, bool leadingZeros ) : void

Toggles whether the value for a specific field is displayed with leading zeros.

SetMaxLength ( int maxLength ) : void

Sets the maximum length for every field in the control.

SetMaxLength ( int fieldIndex, int maxLength ) : void

Sets the maximum length for a specific field in the control. Default value is 3.

SetRange ( int low, int high ) : void

Sets the low and high range for every field.

SetRange ( int fieldIndex, int low, int high ) : void

Sets the low and high range for a specific field.

SetSeparatorText ( int separatorIndex, string text ) : void

Sets the text for a specific separator.

SetSeparatorText ( string text ) : void

Sets the text for every separator.

SetValue ( int value ) : void

Sets the value for every field.

SetValue ( int fieldIndex, int value ) : void

Sets the value for a specific field.

SetValueFormat ( ValueFormat format ) : void

Sets the value format for every field.

SetValueFormat ( int fieldIndex, ValueFormat format ) : void

Sets the value format for a specific field.

ToString ( ) : string

Converts the text of every separator and every field to a single string.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

FlexFieldControl ( ) : System

The constructor.

OnBackColorChanged ( EventArgs e ) : void

Raises the BackColorChanged event.

OnFontChanged ( EventArgs e ) : void

Adjusts the size of the control when font is changed.

OnGotFocus ( EventArgs e ) : void

Raises the GotFocus event.

OnLostFocus ( EventArgs e ) : void

Raises the LostFocus event.

OnMouseDown ( MouseEventArgs e ) : void

Raises the MouseDown event.

OnMouseEnter ( EventArgs e ) : void

Sets the cursor to I-beam when mouse is over control.

OnPaint ( PaintEventArgs e ) : void

Clears the background and fills it with background color. If control has a border, draws it.

OnSizeChanged ( EventArgs e ) : void

Ensures that any size change of control is constrained by allowed range.

Private Methods

Method Description
AdjustSize ( ) : void
CalculateMinimumSize ( ) : Size
Cleanup ( ) : void
GetSuggestedHeight ( ) : int
GetTextMetrics ( IntPtr hwnd, Font font ) : NativeMethods.TEXTMETRIC
HandleMouseDown ( Point location ) : void
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

InitializeControls ( ) : void
IsValidFieldIndex ( int fieldIndex ) : bool
IsValidSeparatorIndex ( int separatorIndex ) : bool
LayoutControls ( ) : void
OnFieldChanged ( object sender, FlexFieldControlLib.FieldChangedEventArgs e ) : void
OnFieldFocus ( object sender, FieldFocusEventArgs e ) : void
OnFieldKeyPressed ( object sender, KeyPressEventArgs e ) : void
OnFieldSizeChanged ( object sender, EventArgs e ) : void
OnFieldValidated ( object sender, FieldValidatedEventArgs e ) : void
OnFocusCeded ( object sender, CedeFocusEventArgs e ) : void
OnSeparatorMouseEvent ( object sender, SeparatorMouseEventArgs e ) : void
OnSeparatorSizeChanged ( object sender, EventArgs e ) : void
Parse ( string text ) : void

Method Details

AddCedeFocusKey() public method

Adds a KeyEventArgs to a specific field that indicates when a field should cede focus to the next field in the control. By default, each field has a single cede focus key -- the [Space] key.
public AddCedeFocusKey ( int fieldIndex, KeyEventArgs e ) : bool
fieldIndex int
e System.Windows.Forms.KeyEventArgs
return bool

AddCedeFocusKey() public method

Adds a KeyEventArgs to every field that indicates when a field should cede focus to the next field in the control. By default, each field has a single cede focus key -- the [Space] key.
public AddCedeFocusKey ( KeyEventArgs e ) : void
e System.Windows.Forms.KeyEventArgs KeyCode /// indicates which keyboard key will cede focus.
return void

Clear() public method

Clears all content from the fields in the control.
public Clear ( ) : void
return void

ClearCedeFocusKeys() public method

Removes every cede focus key from every field in the control.
public ClearCedeFocusKeys ( ) : void
return void

ClearCedeFocusKeys() public method

Removes every cede focus key from a specific field in the control.
public ClearCedeFocusKeys ( int fieldIndex ) : void
fieldIndex int
return void

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

FlexFieldControl() protected method

The constructor.
protected FlexFieldControl ( ) : System
return System

GetCasing() public method

Gets the character casing for a field in the control.
public GetCasing ( int fieldIndex ) : CharacterCasing
fieldIndex int
return CharacterCasing

GetFieldText() public method

Gets the text of a specific field in the control.
public GetFieldText ( int fieldIndex ) : string
fieldIndex int
return string

GetLeadingZeros() public method

Gets whether a field that is not blank has leading zeros.
public GetLeadingZeros ( int fieldIndex ) : bool
fieldIndex int
return bool

GetMaxLength() public method

Gets the maximum number of characters allowed in a specific field.
public GetMaxLength ( int fieldIndex ) : int
fieldIndex int
return int

GetRangeHigh() public method

Gets the high inclusive boundary of allowed values for a specific field. The default value varies based on ValueFormat and MaxLength, but it is always the maximum value that can be represented by the field.
public GetRangeHigh ( int fieldIndex ) : int
fieldIndex int
return int

GetRangeLow() public method

Gets the low inclusive boundary of allowed values for a specific field. Default value is 0.
public GetRangeLow ( int fieldIndex ) : int
fieldIndex int
return int

GetSeparatorText() public method

Gets the text for a specific separator in the control.
public GetSeparatorText ( int separatorIndex ) : string
separatorIndex int
return string

GetValue() public method

Gets the value of a specific field. If the field is blank, its value is the same as its low range value.
public GetValue ( int fieldIndex ) : int
fieldIndex int
return int

GetValueFormat() public method

Gets the value format for a specific field in the control.
public GetValueFormat ( int fieldIndex ) : ValueFormat
fieldIndex int
return ValueFormat

HasFocus() public method

Determines if a specific field has input focus. True indicates that the field has focus.
public HasFocus ( int fieldIndex ) : bool
fieldIndex int
return bool

IsBlank() public method

Determines if every field in the control is blank. True indicates that every field in the control is blank.
public IsBlank ( int fieldIndex ) : bool
fieldIndex int
return bool

OnBackColorChanged() protected method

Raises the BackColorChanged event.
protected OnBackColorChanged ( EventArgs e ) : void
e System.EventArgs
return void

OnFontChanged() protected method

Adjusts the size of the control when font is changed.
protected OnFontChanged ( EventArgs e ) : void
e System.EventArgs
return void

OnGotFocus() protected method

Raises the GotFocus event.
protected OnGotFocus ( EventArgs e ) : void
e System.EventArgs
return void

OnLostFocus() protected method

Raises the LostFocus event.
protected OnLostFocus ( EventArgs e ) : void
e System.EventArgs
return void

OnMouseDown() protected method

Raises the MouseDown event.
protected OnMouseDown ( MouseEventArgs e ) : void
e MouseEventArgs
return void

OnMouseEnter() protected method

Sets the cursor to I-beam when mouse is over control.
protected OnMouseEnter ( EventArgs e ) : void
e System.EventArgs
return void

OnPaint() protected method

Clears the background and fills it with background color. If control has a border, draws it.
protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs
return void

OnSizeChanged() protected method

Ensures that any size change of control is constrained by allowed range.
protected OnSizeChanged ( EventArgs e ) : void
e System.EventArgs
return void

ResetCedeFocusKeys() public method

Removes every cede focus key from every field, and adds the default cede focus key -- the [Space] key -- to every field.
public ResetCedeFocusKeys ( ) : void
return void

ResetCedeFocusKeys() public method

Removes every cede focus key from a specific field, and adds the default cede focus key -- the [Space] key -- to the field.
public ResetCedeFocusKeys ( int fieldIndex ) : void
fieldIndex int
return void

SetCasing() public method

Sets the character casing for every field in the control.
public SetCasing ( CharacterCasing casing ) : void
casing CharacterCasing
return void

SetCasing() public method

Sets the character casing for a specific field in the control.
public SetCasing ( int fieldIndex, CharacterCasing casing ) : void
fieldIndex int
casing CharacterCasing
return void

SetFieldText() public method

Sets text for a specific field in the control.
public SetFieldText ( int fieldIndex, string text ) : void
fieldIndex int
text string
return void

SetFieldText() public method

Sets text for every field in the control.
public SetFieldText ( string text ) : void
text string
return void

SetFocus() public method

Sets input focus to a field in the control.
public SetFocus ( int fieldIndex ) : void
fieldIndex int
return void

SetLeadingZeros() public method

Toggles whether the value for every field is displayed with leading zeros.
public SetLeadingZeros ( bool leadingZeros ) : void
leadingZeros bool true indicates that the value /// is displayed with leading zeros.
return void

SetLeadingZeros() public method

Toggles whether the value for a specific field is displayed with leading zeros.
public SetLeadingZeros ( int fieldIndex, bool leadingZeros ) : void
fieldIndex int Zero-based index for field.
leadingZeros bool true indicates value should be /// displayed with leading zeros.
return void

SetMaxLength() public method

Sets the maximum length for every field in the control.
public SetMaxLength ( int maxLength ) : void
maxLength int
return void

SetMaxLength() public method

Sets the maximum length for a specific field in the control. Default value is 3.
public SetMaxLength ( int fieldIndex, int maxLength ) : void
fieldIndex int
maxLength int
return void

SetRange() public method

Sets the low and high range for every field.
public SetRange ( int low, int high ) : void
low int
high int
return void

SetRange() public method

Sets the low and high range for a specific field.
public SetRange ( int fieldIndex, int low, int high ) : void
fieldIndex int
low int
high int
return void

SetSeparatorText() public method

Sets the text for a specific separator.
public SetSeparatorText ( int separatorIndex, string text ) : void
separatorIndex int
text string
return void

SetSeparatorText() public method

Sets the text for every separator.
public SetSeparatorText ( string text ) : void
text string
return void

SetValue() public method

Sets the value for every field.
public SetValue ( int value ) : void
value int
return void

SetValue() public method

Sets the value for a specific field.
public SetValue ( int fieldIndex, int value ) : void
fieldIndex int
value int
return void

SetValueFormat() public method

Sets the value format for every field.
public SetValueFormat ( ValueFormat format ) : void
format ValueFormat
return void

SetValueFormat() public method

Sets the value format for a specific field.
public SetValueFormat ( int fieldIndex, ValueFormat format ) : void
fieldIndex int
format ValueFormat
return void

ToString() public method

Converts the text of every separator and every field to a single string.
public ToString ( ) : string
return string