LavishGUI:lguilistbox (Data Type)

From Lavish Software Wiki
Revision as of 22:57, 15 December 2005 by Beefalo (talk | contribs)
Jump to navigation Jump to search

Description

This data type provides and controls data for listbox (Element Type).

Members

  • isuifont Font : font object the listbox is using
  • int TextColor : color of the listbox test
  • int BackgroundColor : background color of the listbox
  • int Border : size in pixels of the border
  • int BorderColor : color of the listbox border
  • int SelectionColor : color of a selected item in the listbox
  • string SortType : none, text, value, textreverse, valuereverse, user, or custom
  • bool SelectMultiple : TRUE if selecting multiple items is allowed
  • bool AutoSort : TRUE if the list will autosort according to the SortType
  • lguilistboxitem Item[#] : The nth item in the listbox
  • int Items : The total number of items in the listbox
  • lguilistboxitem SelectedItem : The currently selected item, or the first selected item in a listbox that allows selecting multiple items
  • lguilistboxitem SelectedItem[#] : The nth selected item in a listbox
  • int SelectedItems : The number of selected items in the listbox
  • lguilistboxitem OrderedItem[#] : Same as Item except <#> goes by order in the listbox from top to bottom.

Methods

  • SetTextColor : sets listbox' text color
  • SetBackgroundColor[hex] : set listbox's background color
  • SetBorderColor[hex] : set listbox's border color
  • SetSelectionColor[hex] : set listbox's selection color
  • SetSortType : set listbox's sort type
  • SetSelectMultiple : set SelectMultiple to TRUE or FALSE
  • SetAutoSort : set AutoSort to TRUE or FALSE
  • DeselectItem[#] : unselects item by ID # in the listbox
  • SelectItem[#]: selects item by ID # in the listbox
  • ItemToggleSelect[#] : toggles ID #'s selected status
  • ClearSelection : clears all selected items from the listbox
  • AddItem[text] : adds an item with <text> to the listbox
  • AddItem[text,value] : adds an item with <text> to the listbox and give it <value>
  • AddItem[text,value,color] : adds an item with <text> to the listbox and give it <value> and set its color to <color>
  • RemoveItem[#] : remove item by ID <#>
  • ClearItems : clears all items from listbox
  • Sort : sorts the listbox by the SortType set

Inherits

lguielement

Returns

Same as lguielement.Name

Examples

Display the color of the listbox text

  • echo Listbox color: ${UIElement[ventrilo].FindChild[ventrilo].FindChild[channels].TextColor.Hex}
Output
LIstbox color: ffffffff

Display the SortType of a listbox

  • echo Listbox SortType: ${UIElement[ventrilo].FindChild[ventrilo].FindChild[channels].SortType}
Output
Listbox SortType: none

Display if selecting multiple and AutoSort is on

  • echo Select Multiple? ${UIElement[ventrilo].FindChild[ventrilo].FindChild[channels].SelectMultiple}
  • echo AutoSort? ${UIElement[ventrilo].FindChild[ventrilo].FindChild[channels].AutoSort}
Output
Select Multiple? FALSE
AutoSort? TRUE

Sort all items in listbox

  • UIElement[ventrilo].FindChild[ventrilo].FindChild[channels]:Sort
This command Sorts all items by the technique specified in SortType

Remove all items from listbox

  • UIElement[ventrilo].FindChild[ventrilo].FindChild[channels]:ClearItems
This command clears the listbox of all items

Set AutoSort to TRUE

  • UIElement[ventrilo].FindChild[ventrilo].FindChild[channels]:SetAutoSort[TRUE]
This command sets AutoSort to TRUE

Set Sort type

  • UIElement[ventrilo].FindChild[ventrilo].FindChild[channels]:SetSortType[textreverse]
This command sets SortType to textreverse

Select an item in listbox

  • UIElement[ventrilo].FindChild[ventrilo].FindChild[channels]:SelectItem[3]
This command selects the item in the listbox with ID of 3

Deselect an item in listbox

  • UIElement[ventrilo].FindChild[ventrilo].FindChild[channels]:DeselectItem[3]
This command deselects the item in the listbox with ID of 3

Toggle an items selection status

  • UIElement[ventrilo].FindChild[ventrilo].FindChild[channels]:ItemToggleSelect[5]
This command toggles item 5's selection status

Deselect all items

  • UIElement[ventrilo].FindChild[ventrilo].FindChild[channels]:ClearSelection
This command deselects all items

Remove an item from listbox

  • UIElement[ventrilo].FindChild[ventrilo].FindChild[channels]:RemoveItem[9]
This command removes item 9 from the listbox

See Also