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

This is an abstract class that provides the basic functionality for a Views-enabled ComboBox. Classes that extend this class provide an implementation of the drop down box.
Inheritance: System.Windows.Forms.UserControl, IFWDisposable, IVwNotifyChange, IWritingSystemAndStylesheet
Mostra file Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Property Type Description
m_button DropDownButton
m_comboTextBox ComboTextBox
m_dropDownBox IDropDownBox
m_fListWidthSet bool

Private Properties

Property Type Description
ShowDropDownBox void
m_button_KeyDown void
m_button_MouseDown void
m_comboTextBox_KeyDown void

Public Methods

Method Description
AdjustForStyleSheet ( Form parent, Control grower, IVwStylesheet stylesheet ) : void

Assumes the control is part of a form and should use a stylesheet. This becomes the stylesheet of the text box. If, as a result, the preferred height of this becomes greater than its actual height, the height of this is adjusted to suit. In addition, if grower is not null (grower is typically a containing panel), the height of grower is increased by the same amount. Also, the height of the indicated form is increased, and any top level controls which need it are adjusted appropriately.

AdjustForStyleSheet ( Form parent, Control grower, XCore mediator ) : void

Adjust, figuring the stylesheet based on the main window of the mediator.

CheckDisposed ( ) : void

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.

Form_VisibleChanged ( object sender, EventArgs e ) : void
FwComboBoxBase ( ) : System

Construct one.

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

RemoveTextBoxHighlight ( ) : void
SelectAll ( ) : void

Selects all of the text in the text box.

SetPadding ( ) : void
SetTextBoxHighlight ( ) : void
m_button_GotFocus ( object sender, EventArgs e ) : void
m_button_LostFocus ( object sender, EventArgs e ) : void
m_comboTextBox_GotFocus ( object sender, EventArgs e ) : void
m_comboTextBox_LostFocus ( object sender, EventArgs e ) : void
m_comboTextBox_MouseDown ( object sender, MouseEventArgs e ) : void

Protected Methods

Method Description
CreateDropDownBox ( ) : IDropDownBox

Creates the drop down box.

Dispose ( bool disposing ) : void

Clean up any resources being used.

HideDropDownBox ( ) : void

Hides the drop down box.

OnEnabledChanged ( EventArgs e ) : void

Raises the E:System.Windows.Forms.Control.EnabledChanged event.

OnPaint ( PaintEventArgs e ) : void

Raises the E:System.Windows.Forms.Control.Paint event.

RaiseDropDown ( ) : void

Raises the drop down event.

Select ( bool directed, bool forward ) : void

Activates a child control.

Private Methods

Method Description
ShowDropDownBox ( ) : void
m_button_KeyDown ( object sender, KeyEventArgs e ) : void
m_button_MouseDown ( object sender, MouseEventArgs e ) : void
m_comboTextBox_KeyDown ( object sender, KeyEventArgs e ) : void

Method Details

AdjustForStyleSheet() public method

Assumes the control is part of a form and should use a stylesheet. This becomes the stylesheet of the text box. If, as a result, the preferred height of this becomes greater than its actual height, the height of this is adjusted to suit. In addition, if grower is not null (grower is typically a containing panel), the height of grower is increased by the same amount. Also, the height of the indicated form is increased, and any top level controls which need it are adjusted appropriately.
public AdjustForStyleSheet ( Form parent, Control grower, IVwStylesheet stylesheet ) : void
parent System.Windows.Forms.Form The parent.
grower System.Windows.Forms.Control The grower.
stylesheet IVwStylesheet The stylesheet.
return void

AdjustForStyleSheet() public method

Adjust, figuring the stylesheet based on the main window of the mediator.
public AdjustForStyleSheet ( Form parent, Control grower, XCore mediator ) : void
parent System.Windows.Forms.Form
grower System.Windows.Forms.Control
mediator XCore
return void

CheckDisposed() public method

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.
public CheckDisposed ( ) : void
return void

CreateDropDownBox() protected abstract method

Creates the drop down box.
protected abstract CreateDropDownBox ( ) : IDropDownBox
return IDropDownBox

Dispose() protected method

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

Form_VisibleChanged() public method

public Form_VisibleChanged ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

FwComboBoxBase() public method

Construct one.
public FwComboBoxBase ( ) : System
return System

HideDropDownBox() protected method

Hides the drop down box.
protected HideDropDownBox ( ) : void
return void

OnEnabledChanged() protected method

Raises the E:System.Windows.Forms.Control.EnabledChanged event.
protected OnEnabledChanged ( EventArgs e ) : void
e System.EventArgs An that contains the event data.
return void

OnPaint() protected method

Raises the E:System.Windows.Forms.Control.Paint event.
protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs A that contains the event data.
return void

PropChanged() public method

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

RaiseDropDown() protected method

Raises the drop down event.
protected RaiseDropDown ( ) : void
return void

RemoveTextBoxHighlight() public method

public RemoveTextBoxHighlight ( ) : void
return void

Select() protected method

Activates a child control.
protected Select ( bool directed, bool forward ) : void
directed bool true to specify the direction of the control to select; otherwise, false.
forward bool true to move forward in the tab order; false to move backward in the tab order.
return void

SelectAll() public method

Selects all of the text in the text box.
public SelectAll ( ) : void
return void

SetPadding() public method

public SetPadding ( ) : void
return void

SetTextBoxHighlight() public method

public SetTextBoxHighlight ( ) : void
return void

m_button_GotFocus() public method

public m_button_GotFocus ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

m_button_LostFocus() public method

public m_button_LostFocus ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

m_comboTextBox_GotFocus() public method

public m_comboTextBox_GotFocus ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

m_comboTextBox_LostFocus() public method

public m_comboTextBox_LostFocus ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

m_comboTextBox_MouseDown() public method

public m_comboTextBox_MouseDown ( object sender, MouseEventArgs e ) : void
sender object
e MouseEventArgs
return void

Property Details

m_button protected_oe property

The button that pulls down the list.
protected DropDownButton,SIL.FieldWorks.Common.Widgets m_button
return DropDownButton

m_comboTextBox protected_oe property

The combo text box
protected ComboTextBox,SIL.FieldWorks.Common.Widgets m_comboTextBox
return ComboTextBox

m_dropDownBox protected_oe property

The drop down box
protected IDropDownBox m_dropDownBox
return IDropDownBox

m_fListWidthSet protected_oe property

this flag is set if we receive the DropDownWidth message. Until we receive one of those, the list width tracks the main control width.
protected bool m_fListWidthSet
return bool