Difference between revisions of "Lua:Class:ComboBox"

From Cheat Engine
Jump to navigation Jump to search
(Page creation.)
 
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''ComboBox Class''': (Inheritance: WinControl->Control->Component->Object)
+
[[Category:Lua]]
 +
'''ComboBox Class''': (Inheritance: ''[[Lua:Class:WinControl|WinControl]]''->''[[Lua:Class:Control|Control]]''->''[[Lua:Class:Component|Component]]''->''[[Lua:Class:Object|Object]]'')
  
 
''createComboBox(owner):''
 
''createComboBox(owner):''
Line 8: Line 9:
 
   ItemIndex: integer - Get selected index. -1 is nothing selected
 
   ItemIndex: integer - Get selected index. -1 is nothing selected
 
   Canvas: Canvas - The canvas object used to render on the object
 
   Canvas: Canvas - The canvas object used to render on the object
 
+
 
===methods===
+
===Methods===
 
   clear()
 
   clear()
 
   getItems()
 
   getItems()
Line 16: Line 17:
 
   setItemIndex(integer)
 
   setItemIndex(integer)
 
   getCanvas()
 
   getCanvas()
 +
 +
===Example===
 +
  form = createForm()<br />
 +
  example_box = createComboBox(example_form)
 +
  example_box.items.add("Apple")
 +
  example_box.items.add("Orange")
 +
  example_box.items.add("Banana")<br />
 +
  example_box.onChange = function(sender) print(sender.ItemIndex) end
 +
 +
{{LuaSeeAlso}}

Latest revision as of 01:49, 25 January 2018

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[edit]

 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[edit]

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

Example[edit]

 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[edit]