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

FwComboBox is a simulation of a regular Windows.Forms.ComboBox. It has much the same interface, though not all events and properties are yet supported. There are two main differences: (1) It is implemented using FieldWorks Views, and hence can render Graphite fonts properly. (2) Item labels can be TsStrings, in which case, formatting of items can vary based on the properties of string runs. To get this behavior, you can (a) Let the items actually be ITsStrings. (b) Let the items implement the SIL.FieldWorks.FDO.ITssValue interface, which has just one property, public ITsString AsTss {get;} You must also pass your writing system factory to the FwComboBox (set the WritingSystemFactory property). Otherwise, the combo box will not be able to interpret the writing systems of any TsStrings it is asked to display. It will improve performance to do this even if you are not using TsString data.
Inheritance: FwComboBoxBase, IComboList
Show file Open project: sillsdev/FieldWorks Class Usage Examples

Private Properties

Property Type Description
m_button_KeyPress void
m_comboTextBox_KeyPress void
m_listBox_SameItemSelected void
m_listBox_SelectedIndexChanged void

Public Methods

Method Description
AddItem ( ITsString tss ) : void

Add items to the FWComboBox but adjust the string so it matches the Font size.

FindStringExact ( ITsString tss ) : int

Find the index where exactly this string occurs in the list, or -1 if it does not.

FindStringExact ( string str ) : int

Find the index where exactly this string occurs in the list, or -1 if it does not.

FwComboBox ( ) : System

Construct one.

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

SetTssWithoutChangingSelectedIndex ( ITsString tss ) : void

This is used (e.g., in filter bar) when the text we want to show in the combo is something different from the text of the selected item.

Protected Methods

Method Description
CreateDropDownBox ( ) : IDropDownBox

Creates the drop down box.

Dispose ( bool disposing ) : void

Clean up any resources being used.

RaiseSelectedIndexChanged ( ) : void

Fire the SelectedIndexChanged event.

Private Methods

Method Description
m_button_KeyPress ( object sender, KeyPressEventArgs e ) : void

Handle a key press in the combo box. If it is a dropdown list use typing to try to make a selection (cf. LT-2190).

m_comboTextBox_KeyPress ( object sender, KeyPressEventArgs e ) : void

Handle a key press in the combo box. If it is a dropdown list use typing to try to make a selection (cf. LT-2190).

m_listBox_SameItemSelected ( object sender, EventArgs e ) : void
m_listBox_SelectedIndexChanged ( object sender, EventArgs e ) : void

Method Details

AddItem() public method

Add items to the FWComboBox but adjust the string so it matches the Font size.
public AddItem ( ITsString tss ) : void
tss ITsString
return void

CreateDropDownBox() protected method

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

Dispose() protected method

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

FindStringExact() public method

Find the index where exactly this string occurs in the list, or -1 if it does not.
public FindStringExact ( ITsString tss ) : int
tss ITsString
return int

FindStringExact() public method

Find the index where exactly this string occurs in the list, or -1 if it does not.
public FindStringExact ( string str ) : int
str string
return int

FwComboBox() public method

Construct one.
public FwComboBox ( ) : System
return System

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

RaiseSelectedIndexChanged() protected method

Fire the SelectedIndexChanged event.
protected RaiseSelectedIndexChanged ( ) : void
return void

SetTssWithoutChangingSelectedIndex() public method

This is used (e.g., in filter bar) when the text we want to show in the combo is something different from the text of the selected item.
public SetTssWithoutChangingSelectedIndex ( ITsString tss ) : void
tss ITsString
return void