Difference between revisions of "LavishGUI:listbox (Element Type)"

From Lavish Software Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
 
=== What is a List Box? ===
 
=== What is a List Box? ===
A listbox is a box to display a list of items for a user to choose one or more items from. [[LavishGUI:lguilistbox_%28Data_Type%29|lguilistbox (Data Type)]] is used to provide access via LavishScript.
+
A listbox is a box to display a list of items for a user to choose one or more items from. [[LavishGUI:lguilistbox_%28Data_Type%29|lguilistbox (Data Type)]] and [[LavishGUI:lguilistboxitem_%28Data_Type%29|lguilistboxitem (Data Type)]] are used to provide access via LavishScript.
 
== Using List Boxes ==
 
== Using List Boxes ==
 
List Boxes are descendants of the [[LavishGUI:Elements|base]] element type.  Any attributes of the [[LavishGUI:Elements|base]] element type may be applied in addition to the list box-specific properties described below.
 
List Boxes are descendants of the [[LavishGUI:Elements|base]] element type.  Any attributes of the [[LavishGUI:Elements|base]] element type may be applied in addition to the list box-specific properties described below.

Revision as of 23:05, 15 December 2005

Introduction

What is a List Box?

A listbox is a box to display a list of items for a user to choose one or more items from. lguilistbox (Data Type) and lguilistboxitem (Data Type) are used to provide access via LavishScript.

Using List Boxes

List Boxes are descendants of the base element type. Any attributes of the base element type may be applied in addition to the list box-specific properties described below.

List Box-Specific Properties

  • BackgroundColor
Background color
  • Border
Size of border around the element. This border is included in the size of the element
  • BorderColor
Border color
  • Font
Font reference (Name, Size, Color)
  • Items
Container element for list items
  • SelectMultiple
Enable if the list box should allow multiple items to be selected
  • SelectionColor
Selection highlight color
  • Sort
None, User (allows users to drag items to reorder them), Text, Value
  • Texture
Texture, if any

Embedded Script

  • OnSelect
Executes when an item is selected. Integer variable ID contains the ID of the newly selected item.
  • OnDeselect
Executes when an item is selected. Integer variable ID contains the ID of the deselected item.

List Items

List items are defined within the Items container element with an "Item" tag. Items may have a Value attribute, which indicates a whole number value to be associated with the item. Items may also have a Color attribute, which indicates the text color to be used for that particular item. Text contained by the Item begin and end tags will be used as the displayed text of the list item.


Examples

	<listbox name='TestListBox'>
		<X>400</X>
		<Y>400</Y>
		<Width>120</Width>
		<Height>120</Height>
		<SelectMultiple>1</SelectMultiple>
		<Sort>Text</Sort>
		<Texture filename='Listbox.png'/>
		<Items>
			<Item Value='1'>Item1</Item>
			<Item Value='2'>Item2</Item>
		</Items>
	</listbox>

See Also