Updated Dropdown (markdown)
26
Dropdown.md
26
Dropdown.md
@@ -1 +1,25 @@
|
|||||||
WIP
|
Dropdowns are objects which looks like a button, but as soon as you click on them, they will open a dropdown where you can choose a value. But first you will have to add possible values
|
||||||
|
|
||||||
|
Here is a example of how to create a standard dropdown:
|
||||||
|
|
||||||
|
````lua
|
||||||
|
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
|
||||||
|
local aDropdown = mainFrame:addDropdown("myFirstDropdown"):show()
|
||||||
|
````
|
||||||
|
|
||||||
|
This will create a default dropdown with the size 5 width and 1 height on position 1 1 (relative to its parent frame), the default background is colors.lightBlue, the default text color is colors.black and the default zIndex is 10. The default horizontal text align is "center"
|
||||||
|
|
||||||
|
Here are all possible functions available for dropdowns. Remember dropdown inherit from [object](https://github.com/NoryiE/NyoUI/wiki/Object):
|
||||||
|
|
||||||
|
## addItem
|
||||||
|
Adds a item to the list
|
||||||
|
|
||||||
|
````lua
|
||||||
|
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
|
||||||
|
local aDropdown = mainFrame:addDropdown("myFirstDropdown"):show()
|
||||||
|
aDropDown:addItem("1. Entry")
|
||||||
|
aDropDown:addItem("2. Entry",colors.yellow)
|
||||||
|
aDropDown:addItem("3. Entry",colors.yellow,colors.green)
|
||||||
|
````
|
||||||
|
**args:** text, bgcolor, fgcolor, ..., text is the displayed text, bgcolor and fgcolors the colors of background/text and args (...) is something dynamic, you wont see them but if you require some more information per item you can use that.<br>
|
||||||
|
**returns:** the object<br>
|
||||||
Reference in New Issue
Block a user