Core Function GUIListBox

From Sputnik Wiki
Jump to: navigation, search
GUITListBox( <listbox> )

Contents

Description

Properties & Functions specifically for ListBox

Parameters

listbox

The ListBox 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.

SelectionMode

Get/Set the selection mode

GUIListBox( $ListBox, "SelectionMode" ); // get
GUIListBox( $ListBox, "SelectionMode", @SelModeNone); // set
# Options
# @SelModeNone
# @SelModeOne
# @SelModeMultiSimple
# @SelModeMultiExtended

ClearSelected

Unselect any/all items

GUIListBox( $ListBox, "ClearSelected" );

Clear

Delete all items from the item list

GUIListBox( $ListBox, "Clear" );

ItemExists

Check if an item exists in the list

GUIListBox( $ListBox, "ItemExists", $Value );

ItemExistsLC

Check if an item exists in the list (case insensitive)

GUIListBox( $ListBox, "ItemExistsLC", $Value );

GetItems

Get all the items as an array

$Items = GUIListBox( $ListBox, "GetItems" );
foreach($Items as $i)
{
	println("Item '$i'");
}

SetItems

Set the items from an array (Will clear the items)

GUIListBox( $ListBox, "SetItems", array("One", "Two", "Three") );

AddItem

Add an item to the item list

GUIListBox( $ListBox, "AddItem", "Four" );

AddItems

Add an item array to the item list

GUIListBox( $ListBox, "AddItems", array(500, 600, 700, "Hello") );

InsertItem

Insert an item to the item list at a given location

GUIListBox( $ListBox, "InsertItem", "Six", 5 );

Returns 1 on success

InsertItems

Insert an array of items to the item list at a given location

GUIListBox( $ListBox, "InsertItems", array("One", "Two", "Three"), 3 );

Returns 1 on success

DelItem

Delete an item from the item list

GUIListBox( $ListBox, "DelItem", "Five" );

DelItemAt

Delete an item from the item list at a given location

GUIListBox( $ListBox, "DelItemAt", 4 );

Returns 1 on success

SelectedIndex

Returns the index of the currently selected index or sets it

Get:

$SelIndex = GUIListBox( $ListBox, "SelectedIndex" );
println("Currently selected index '$SelIndex'");

Set:

GUIListBox( $ListBox, "SelectedIndex", 2);

Returns -1 is nothing is selected or invalid selection

SelectedItem

Returns the currently selected item or sets it

Get:

$SelItem = GUIListBox( $ListBox, "SelectedItem" );
println("Currently selected item '$SelItem'");

Set:

GUIListBox( $ListBox, "SelectedItem", "Five");

Returns -1 is nothing is selected or invalid selection

SelectedText

Returns the currently selected text

$SelText = GUIListBox( $ListBox, "SelectedText" );
println("Currently selected text '$SelText'");

Returns empty string is nothing is selected or invalid selection

Example

Go see GUICreate( "ListBox" ) for example.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox