LavishGUI:combobox (Element Type)

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

Introduction

What is a Combo Box?

A combo box is a drop down listbox. lguicombobox (Data Type) is used to provide access via LavishScript.

Using Combo Boxes

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

Combo Box-Specific Properties

  • Texture
Texture of the overall combobox
  • ButtonTexture
Texture displayed when the button is in its normal, unpressed state.
  • Font
Font reference (Name, Size, Color)
  • Border
Size of border around the element. This border is included in the size of the element
  • FullHeight
Size of the drop down listbox when open
  • ButtonWidth
Width of the combobox button
  • Sort
None, User (allows users to drag items to reorder them), Text, Value
  • Items
Container element for list items
  • ListBox
Container element for the listbox to use. This must be the entire listbox, but does not need to be named, and positioning will be ignored (the box is automatically positioned)

Embedded Script

  • OnSelect
Executes when an item is selected. Integer variable ID contains the ID of the newly selected 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

Example code

	<combobox name='TestComboBox'>
		<Width>150</Width> 
		<Height>20</Height> 
               <FullHeight>200</FullHeight>
               <ButtonWidth>20</ButtonWidth>
		<Items>
		<Item Value='1'>Cheese</Item>
		<Item Value='2'>Pickles</Item>
		</Items>
	</combobox>

See Also