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
Afficher le fichier Open project: sillsdev/FieldWorks Class Usage Examples

Private Properties

Свойство Type Description
m_button_KeyPress void
m_comboTextBox_KeyPress void
m_listBox_SameItemSelected void
m_listBox_SelectedIndexChanged void

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

Méthode 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 méthode

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

CreateDropDownBox() protected méthode

Creates the drop down box.
protected CreateDropDownBox ( ) : IDropDownBox
Résultat IDropDownBox

Dispose() protected méthode

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

FindStringExact() public méthode

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

FindStringExact() public méthode

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

FwComboBox() public méthode

Construct one.
public FwComboBox ( ) : System
Résultat System

PropChanged() public méthode

public PropChanged ( int hvo, int tag, int ivMin, int cvIns, int cvDel ) : void
hvo int
tag int
ivMin int
cvIns int
cvDel int
Résultat void

RaiseSelectedIndexChanged() protected méthode

Fire the SelectedIndexChanged event.
protected RaiseSelectedIndexChanged ( ) : void
Résultat void

SetTssWithoutChangingSelectedIndex() public méthode

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
Résultat void