
ComboBox
IComboBox
ComboBox Methods
| ComboBox() | Constructor for the ComboBox class |
| AddListItem() | Adds a text item to the end of the selection list (unless auto sort is on) |
| AddTextChangedHandler() | Registers an event handler for a text changed event using a method reference |
| AddTextChangedHandler() | Registers an event handler for a text changed event using an IComboBox reference |
| AddEnterKeyHandler() | Registers an event handler for an enter key event using a method reference |
| AddEnterKeyHandler() | Registers an event handler for an enter key event using an IComboBox reference |
| OnTextChanged() | Virtual method to handle TextChanged events - can be overridden |
| OnEnterKey() | Virtual method to handle EnterKey events - can be overridden |
IComboBox Methods
| OnTextChanged() | Abstract method to handle TextChanged events - must be overridden |
| OnEnterKey() | Abstract method to handle EnterKey events - must be overridden |
Derived Classes
None
See Also
Class Hierarchy, Frame, ChildFrame, Dialog, Edit, TextChangedEvent, EnterKeyEvent
public method ComboBox(Window Parent, int XPos, int YPos, int Width, int Height, string TextString, bool AllowEdit = true, bool AutoSort = false, bool UseDropDown = true)
Parameters
Parent
Parent window for the combo box control
XPos
One based X position of control relative to parent
YPos
One based Y position of control relative to parent
Width
Initial width of the control in pixels
Height
Initial height of the control in pixels
TextString
Initial string to be used in the edit box
AllowEdit
Allow editing in the control if true, only from list if false
AutoSort
Sort the list alphabetically if true
UseDropDown
Use drop down list with arrow icon if true, list always visible if false
Return Value
None
Description
Constructor for the ComboBox class.
ComboBox Class
public method AddListItem(string SelectionString)
Parameters
SelectionString
String to append at end of list for combo box selection list
Return Value
NONE
Description
This method adds an item to the end of the combo box selection list. If the auto sort flag is set in the constructor, the item will be added into the appropriate location in the list based on the alphabetic sort.
ComboBox Class
public method AddTextChangedHandler(TextChangedHandler Handler, Base ExtraObject = null)
Parameters
Handler
Method reference to be executed when the event occurs
ExtraObject
Optional object which will be sent along to each event handler when it is executed
Return Value
NONE
Description
This method registers a method reference to be executed when a "text changed" event occurs within the ComboBox object (either from typing or selection from the list). The event provides a copy of the "old string" and the "new string". This event occurs "after the fact", the text has already been modified, but it allows the script to perform validation on the new data. The text can also be restored to "old string" if preferred.
As is true with all Aztec event handling, this method can be called by any thread. When the event occurs, each registered event handler is scheduled to execute within the thread that registered it. So an event sent to one thread can be handled by event handlers executing in one or more other threads.
The TextChangedHandler data type represents a method reference specific to a handler for TextChangedEvent. TextChangedHandler is defined as follows:
public type<method<TextChangedEvent,Base>> TextChangedHandler
Given this definition, the method handler must be defined with the following signature (name can be anything):
public method TextChangedMethod(TextChangedEvent event, Base Extra) { }.
ComboBox Class
public method AddTextChangedHandler(IComboBox Interface, Base ExtraObject = null)
Parameters
Interface
Reference to an IComboBox object
ExtraObject
Optional object which will be sent along to each event handler when it is executed
Return Value
NONE
Description
This method registers an IComboBox interface object to be executed when a "text changed" event occurs for this ComboBox control. An optional object can also be registered which will be sent to each event handler as it is executed.
As is true with all Aztec event handling, this method can be called by any thread. When the event occurs, each registered event handler is scheduled to execute within the thread that registered it. So an event sent to one thread can be handled by event handlers executing in one or more other threads.
When the text is modified in the ComboBox control, the OnTextChanged() method within the IComboBox object will be executed.
ComboBox Class
public method AddEnterKeyHandler(EnterKeyHandler Handler, Base ExtraObject = null)
Parameters
Handler
Method reference to be executed when the event occurs
ExtraObject
Optional object which will be sent along to each event handler when it is executed
Return Value
NONE
Description
This method registers a method reference to be executed when an "enter key" event occurs within the edit box within the ComboBox control (as opposed to using enter to select an item from the list).
As is true with all Aztec event handling, this method can be called by any thread. When the event occurs, each registered event handler is scheduled to execute within the thread that registered it. So an event sent to one thread can be handled by event handlers executing in one or more other threads.
The EnterKeyHandler data type represents a method reference specific to a handler for EnterKeyEvent. EnterKeyHandler is defined as follows:
public type<method<EnterKeyEvent,Base>> EnterKeyHandler
Given this definition, the method handler must be defined with the following signature (name can be anything):
public method EnterKeyMethod(EnterKeyEvent event, Base Extra) { }.
ComboBox Class
public method AddEnterKeyHandler(IComboBox Interface, Base ExtraObject = null)
Parameters
Interface
Reference to an IComboBox object
ExtraObject
Optional object which will be sent along to each event handler when it is executed
Return Value
NONE
Description
This method registers an IComboBox interface object to be executed when an "enter key" event occurs for the edit box within this ComboBox control. An optional object can also be registered which will be sent to each event handler as it is executed.
As is true with all Aztec event handling, this method can be called by any thread. When the event occurs, each registered event handler is scheduled to execute within the thread that registered it. So an event sent to one thread can be handled by event handlers executing in one or more other threads.
When the Enter key is pressed in the edit box, the OnEnterKey() method within the IComboBox object will be executed.
ComboBox Class
public method virtual OnTextChanged(TextChangedEvent TextEvent, Base ExtraObject)
Parameters
TextEvent
TextChangedEvent object associated with the event
ExtraObject
Optional object sent along from when it was registered
Return Value
NONE
Description
This method is the event handler for TextChangedEvent for the ComboBox control. It is invoked internally when the text is changed (character is typed into the edit box or selection from list). This method in turn executes every registered handler with the same argument list which comes in. Both implementations of the ComboBox.AddTextChangedHandler() method register the event handlers which get invoked by this method.
If this method is overridden by a class derived from ComboBox, it must call this implementation of the method if it needs to execute handlers registered with the ComboBox.AddTextChangedHandler() methods.
ComboBox Class
public method virtual OnEnterKey(EnterKeyEvent KeyEvent, Base ExtraObject)
Parameters
KeyEvent
EnterKeyEvent object associated with the event
ExtraObject
Optional object sent along from when it was registered
Return Value
NONE
Description
This method is the event handler for EnterKeyEvent for the edit box within the ComboBox control. It is invoked internally when the text is changed (character is typed into the edit box or selection from list). This method in turn executes every registered handler with the same argument list which comes in. Both implementations of the ComboBox.AddEnterKeyHandler() method register the event handlers which get invoked by this method.
If this method is overridden by a class derived from ComboBox, it must call this implementation of the method if it needs to execute handlers registered with the ComboBox.AddEnterKeyHandler() methods.
ComboBox Class
public method abstract OnTextChanged(TextChangedEvent TextEvent, Base ExtraObject)
Parameters
TextEvent
TextChangedEvent object associated with the event
ExtraObject
Optional object sent along from when it was registered
Return Value
NONE
Description
This abstract method is the event handler for TextChangedEvent within the IComboBox interface class. The method which overrides it is invoked for TextChangedEvent within a ComboBox object when the interface object is registered with the ComboBox.AddTextChangedHandler() method.
IComboBox Class
public method abstract OnEnterKey(EnterKeyEvent KeyEvent, Base ExtraObject)
Parameters
KeyEvent
EnterKeyEvent object associated with the event
ExtraObject
Optional object sent along from when it was registered
Return Value
NONE
Description
This abstract method is the event handler for EnterKeyEvent within the IComboBox interface class. The method which overrides it is invoked for EnterKeyEvent within a ComboBox object when the interface object is registered with the ComboBox.AddEnterKeyHandler() method.
IComboBox Class