Difference between revisions of "Lua:Class:ComboBox"

From Cheat Engine
Jump to navigation Jump to search
Line 25: Line 25:
 
   example_box.items.add("Banana")<br />
 
   example_box.items.add("Banana")<br />
 
   example_box.onChange = function(sender) print(sender.ItemIndex) end
 
   example_box.onChange = function(sender) print(sender.ItemIndex) end
 +
 +
{{LuaSeeAlso}}

Revision as of 21:51, 19 March 2017

ComboBox Class: (Inheritance: WinControl->Control->Component->Object)

createComboBox(owner): Creates a ComboBox class object which belongs to the given owner. Owner can be any object inherited from WinControl

properties

 Items: Strings - Strings derived object containings all the items in the list
 ItemIndex: integer - Get selected index. -1 is nothing selected
 Canvas: Canvas - The canvas object used to render on the object

Methods

 clear()
 getItems()
 setItems()
 getItemIndex()
 setItemIndex(integer)
 getCanvas()

Example

 form = createForm()
example_box = createComboBox(example_form) example_box.items.add("Apple") example_box.items.add("Orange") example_box.items.add("Banana")
example_box.onChange = function(sender) print(sender.ItemIndex) end

See also