Core Function GUIComboBox

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
m (1 revision)
 
(8 intermediate revisions by one user not shown)
Line 16: Line 16:
  
 
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.
 
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
 +
 +
<syntaxhighlight lang="sputnik">
 +
GUIComboBox( $Combo, "Clear" );
 +
</syntaxhighlight>
  
 
==== GetItems ====
 
==== GetItems ====
Line 31: Line 39:
 
==== SetItems ====
 
==== SetItems ====
  
Set the items from an array
+
Set the items from an array (Will clear the items)
  
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
Line 43: Line 51:
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
 
GUIComboBox( $Combo, "AddItem", "Four" );
 
GUIComboBox( $Combo, "AddItem", "Four" );
 +
</syntaxhighlight>
 +
 +
==== AddItems ====
 +
 +
Add an item array to the item list
 +
 +
<syntaxhighlight lang="sputnik">
 +
GUIComboBox( $Combo, "AddItems", array(500, 600, 700, "Hello") );
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 51: Line 67:
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
 
GUIComboBox( $Combo, "InsertItem", "Six", 5 );
 
GUIComboBox( $Combo, "InsertItem", "Six", 5 );
 +
</syntaxhighlight>
 +
 +
Returns 1 on success
 +
 +
==== InsertItems ====
 +
 +
Insert an array of items to the item list at a given location
 +
 +
<syntaxhighlight lang="sputnik">
 +
GUIComboBox( $Combo, "InsertItems", array("One", "Two", "Three"), 3 );
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 134: Line 160:
  
 
Returns 0 is nothing is selected or invalid selection
 
Returns 0 is nothing is selected or invalid selection
 
  
 
==== SelectionStart ====
 
==== SelectionStart ====
Line 152: Line 177:
  
 
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 ====

Latest revision as of 12:37, 14 June 2015

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.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox