Core Function GUIComboBox
(→DropDownStyle) |
|||
Line 152: | Line 152: | ||
Returns 0 is nothing is selected or invalid selection | Returns 0 is nothing is selected or invalid selection | ||
+ | |||
+ | ==== DropDownHeight ==== | ||
+ | |||
+ | Get or set the dropped down height | ||
+ | |||
+ | Get: | ||
+ | <syntaxhighlight lang="sputnik"> | ||
+ | $Height = GUIComboBox( $Combo, "DropDownHeight"); | ||
+ | println("The drop down height is $Height"); | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Set: | ||
+ | <syntaxhighlight lang="sputnik"> | ||
+ | GUIComboBox( $Combo, "DropDownHeight", 100); | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ==== DropDownWidth ==== | ||
+ | |||
+ | Get or set the dropped down width | ||
+ | |||
+ | Get: | ||
+ | <syntaxhighlight lang="sputnik"> | ||
+ | $Width = GUIComboBox( $Combo, "DropDownWidth"); | ||
+ | println("The drop down width is $Width"); | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Set: | ||
+ | <syntaxhighlight lang="sputnik"> | ||
+ | GUIComboBox( $Combo, "DropDownWidth", 100); | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ==== DroppedDown ==== | ||
+ | |||
+ | Get or set the dropped down state | ||
+ | |||
+ | Get: | ||
+ | <syntaxhighlight lang="sputnik"> | ||
+ | $DroppedState = GUIComboBox( $Combo, "DroppedDown"); | ||
+ | if($DroppedState) | ||
+ | { | ||
+ | println("The drop down is showing"); | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | println("The drop down is hidden"); | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Set (This will actually show the dropped down part if higher than 0): | ||
+ | <syntaxhighlight lang="sputnik"> | ||
+ | GUIComboBox( $Combo, "DroppedDown", 1 ); | ||
+ | </syntaxhighlight> | ||
==== DropDownStyle ==== | ==== DropDownStyle ==== |
Revision as of 07:26, 15 December 2011
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.
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
GUIComboBox( $Combo, "SetItems", array("One", "Two", "Three") );
AddItem
Add an item to the item list
GUIComboBox( $Combo, "AddItem", "Four" );
InsertItem
Insert an item to the item list at a given location
GUIComboBox( $Combo, "InsertItem", "Six", 5 );
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.