Core Function GUIComboBox

From Sputnik Wiki
Revision as of 07:18, 15 December 2011 by UberFoX (Talk | contribs)
Jump to: navigation, search
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

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.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox