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

FwListBox is a simulation of a regular Windows.Forms.ListBox. 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 FwListBox (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: System.Windows.Forms.Panel, IFWDisposable, IVwNotifyChange
Afficher le fichier Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Свойство Type Description
m_highlightedIndex int
m_selectedIndex int

Private Properties

Свойство Type Description
EnsureRoot void
FwListBox System
GetItem object
RaiseSameItemSelected void
RaiseSelectedIndexChanged void
SetItem void

Méthodes publiques

Méthode Description
BeginUpdate ( ) : void

Begins the update.

CheckDisposed ( ) : void

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

EndUpdate ( ) : void

Ends the update.

FindStringExact ( string str ) : int

Find the index where the specified string occurs. If it does not, or the argument is null, return -1.

FocusAndCapture ( ) : void

Move the focus to the real view. (Used to capture the mouse also, but that interferes with the scroll bar, so I'm using a filter instead.)

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

Receives notifications when something in the data cache changes.

ScrollHighlightIntoView ( ) : void

Scroll so that the selection can be seen.

TextOfItem ( object item ) : ITsString

Obtain the text corresponding to the specified item in your contents list.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

FindIndexOfTss ( ITsString tss ) : int

Find the index where the specified TsString occurs. If it does not, or the argument is null, return -1.

IsHighlighted ( int index ) : bool

IsSelected ( int index ) : bool

Answer whether the indicated index is selected. This is trivial now, but will be less so if we implement multiple selections.

Private Methods

Méthode Description
EnsureRoot ( ) : void

Ensure the root box has been created.

FwListBox ( ) : System
GetItem ( int itemIndex ) : object

Gets the item.

RaiseSameItemSelected ( ) : void

Fire the SameItemSelected event.

RaiseSelectedIndexChanged ( ) : void

Fire the SelectedIndexChanged event.

SetItem ( object item, int &itemIndex ) : void

Sets the item.

Method Details

BeginUpdate() public méthode

Begins the update.
public BeginUpdate ( ) : void
Résultat void

CheckDisposed() public méthode

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

Dispose() protected méthode

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

EndUpdate() public méthode

Ends the update.
public EndUpdate ( ) : void
Résultat void

FindIndexOfTss() protected méthode

Find the index where the specified TsString occurs. If it does not, or the argument is null, return -1.
protected FindIndexOfTss ( ITsString tss ) : int
tss ITsString
Résultat int

FindStringExact() public méthode

Find the index where the specified string occurs. If it does not, or the argument is null, return -1.
public FindStringExact ( string str ) : int
str string
Résultat int

FocusAndCapture() public méthode

Move the focus to the real view. (Used to capture the mouse also, but that interferes with the scroll bar, so I'm using a filter instead.)
public FocusAndCapture ( ) : void
Résultat void

IsHighlighted() protected méthode

protected IsHighlighted ( int index ) : bool
index int
Résultat bool

IsSelected() protected méthode

Answer whether the indicated index is selected. This is trivial now, but will be less so if we implement multiple selections.
protected IsSelected ( int index ) : bool
index int
Résultat bool

PropChanged() public méthode

Receives notifications when something in the data cache changes.
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

ScrollHighlightIntoView() public méthode

Scroll so that the selection can be seen.
public ScrollHighlightIntoView ( ) : void
Résultat void

TextOfItem() public méthode

Obtain the text corresponding to the specified item in your contents list.
public TextOfItem ( object item ) : ITsString
item object
Résultat ITsString

Property Details

m_highlightedIndex protected_oe property

The index highlighted, may be different from selected during tracking in combo. This is set true in a combo box, when we want to track mouse movement by highlighting the item hovered over. When it is true, changing the selected index does not trigger events, but a MouseDown does.
protected int m_highlightedIndex
Résultat int

m_selectedIndex protected_oe property

The index actually selected.
protected int m_selectedIndex
Résultat int