Core Function GUIComboBox
GUIComboBox( <combobox> )
Contents |
Description
Properties & Functions specifically for ComboBox
Parameters
combobox
The ComboBox GUI object to use.
Functions
Note - Anything is not listed here will most likely be be found in GUIGetProp and GUISetProp or GUIPropInvoke etc this is because a lot of properties and stuf is actually generic for many controls.
Clear
Delete all items from the item list
GUIComboBox( $Combo, "Clear" );
GetItems
Get all the items as an array
$Items = GUIComboBox( $Combo, "GetItems" ); foreach($Items as $i) { println("Item '$i'"); }
SetItems
Set the items from an array (Will clear the items)
GUIComboBox( $Combo, "SetItems", array("One", "Two", "Three") );
AddItem
Add an item to the item list
GUIComboBox( $Combo, "AddItem", "Four" );
AddItems
Add an item array to the item list
GUIComboBox( $Combo, "AddItems", array(500, 600, 700, "Hello") );
InsertItem
Insert an item to the item list at a given location
GUIComboBox( $Combo, "InsertItem", "Six", 5 );
Returns 1 on success
InsertItems
Insert an array of items to the item list at a given location
GUIComboBox( $Combo, "InsertItems", array("One", "Two", "Three"), 3 );
Returns 1 on success
DelItem
Delete an item from the item list
GUIComboBox( $Combo, "DelItem", "Five" );
DelItemAt
Delete an item from the item list at a given location
GUIComboBox( $Combo, "DelItemAt", 4 );
Returns 1 on success
SelectedIndex
Returns the index of the currently selected index or sets it
Get:
$SelIndex = GUIComboBox( $Combo, "SelectedIndex" ); println("Currently selected index '$SelIndex'");
Set:
GUIComboBox( $Combo, "SelectedIndex", 2);
Returns -1 is nothing is selected or invalid selection
SelectedItem
Returns the currently selected item or sets it
Get:
$SelItem = GUIComboBox( $Combo, "SelectedItem" ); println("Currently selected item '$SelItem'");
Set:
GUIComboBox( $Combo, "SelectedItem", "Five");
Returns -1 is nothing is selected or invalid selection
SelectedText
Returns the currently selected text
$SelText = GUIComboBox( $Combo, "SelectedText" ); println("Currently selected text '$SelText'");
Returns empty string is nothing is selected or invalid selection
SelectionLength
Returns the length of the currently selected text or sets it
Get:
$SelLength = GUIComboBox( $Combo, "SelectionLength" ); println("Currently selected text length '$SelLength'");
Set:
GUIComboBox( $Combo, "SelectionLength", 2 );
Returns 0 is nothing is selected or invalid selection
SelectionStart
Returns the start of the currently selected text or sets it
Get:
$SelStart = GUIComboBox( $Combo, "SelectionStart" ); println("Currently selected text start '$SelStart'");
Set:
UIComboBox( $Combo, "SelectionStart", 1 );
Returns 0 is nothing is selected or invalid selection
DropDownHeight
Get or set the dropped down height
Get:
$Height = GUIComboBox( $Combo, "DropDownHeight"); println("The drop down height is $Height");
Set:
GUIComboBox( $Combo, "DropDownHeight", 100);
DropDownWidth
Get or set the dropped down width
Get:
$Width = GUIComboBox( $Combo, "DropDownWidth"); println("The drop down width is $Width");
Set:
GUIComboBox( $Combo, "DropDownWidth", 100);
DroppedDown
Get or set the dropped down state
Get:
$DroppedState = GUIComboBox( $Combo, "DroppedDown"); if($DroppedState) { println("The drop down is showing"); } else { println("The drop down is hidden"); }
Set (This will actually show the dropped down part if higher than 0):
GUIComboBox( $Combo, "DroppedDown", 1 );
DropDownStyle
Set the drop down style
GUIComboBox( $Combo, "DropDownStyle", "dropdownlist");
Options:
DropDown DropDownList Simple
Returns 0 if failed
Example
Go see GUICreate( "ComboBox" ) for example.