Some docs updates
This commit is contained in:
@@ -13,8 +13,8 @@ Adds a item into the list
|
||||
#### Usage:
|
||||
* Creates a default menubar with 3 entries
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aMenubar = mainFrame:addMenubar()
|
||||
local main = basalt.createFrame()
|
||||
local aMenubar = main:addMenubar()
|
||||
:addItem("1. Entry")
|
||||
:addItem("2. Entry",colors.yellow)
|
||||
:addItem("3. Entry",colors.yellow,colors.green)
|
||||
|
||||
@@ -7,8 +7,8 @@ Removes all items.
|
||||
#### Usage:
|
||||
* Creates a default menubar with 3 entries and removes them immediatley. Which makes no sense.
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aMenubar = mainFrame:addMenubar()
|
||||
local main = basalt.createFrame()
|
||||
local aMenubar = main:addMenubar()
|
||||
:addItem("1. Entry")
|
||||
:addItem("2. Entry",colors.yellow)
|
||||
:addItem("3. Entry",colors.yellow,colors.green)
|
||||
|
||||
@@ -14,8 +14,8 @@ Edits a item from the menubar
|
||||
#### Usage:
|
||||
* Creates a default menubar with 3 entries and edits the second one.
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aMenubar = mainFrame:addMenubar()
|
||||
local main = basalt.createFrame()
|
||||
local aMenubar = main:addMenubar()
|
||||
:addItem("1. Entry")
|
||||
:addItem("2. Entry",colors.yellow)
|
||||
:addItem("3. Entry",colors.yellow,colors.green)
|
||||
|
||||
@@ -7,8 +7,8 @@ Returns all items as table
|
||||
#### Usage:
|
||||
* Creates a default menubar with 3 entries and prints a table.
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aMenubar = mainFrame:addMenubar()
|
||||
local main = basalt.createFrame()
|
||||
local aMenubar = main:addMenubar()
|
||||
:addItem("1. Entry")
|
||||
:addItem("2. Entry",colors.yellow)
|
||||
:addItem("3. Entry",colors.yellow,colors.green)
|
||||
|
||||
@@ -10,8 +10,8 @@ Returns a item by index
|
||||
#### Usage:
|
||||
* Creates a default menubar with 3 entries and edits the second one.
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aMenubar = mainFrame:addMeubar()
|
||||
local main = basalt.createFrame()
|
||||
local aMenubar = main:addMeubar()
|
||||
:addItem("1. Entry")
|
||||
:addItem("2. Entry",colors.yellow)
|
||||
:addItem("3. Entry",colors.yellow,colors.green)
|
||||
|
||||
@@ -7,8 +7,8 @@ Returns the current item count
|
||||
#### Usage:
|
||||
* Creates a default menubar with 3 entries and prints the current item count.
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aMenubar = mainFrame:addMenubar()
|
||||
local main = basalt.createFrame()
|
||||
local aMenubar = main:addMenubar()
|
||||
:addItem("1. Entry")
|
||||
:addItem("2. Entry",colors.yellow)
|
||||
:addItem("3. Entry",colors.yellow,colors.green)
|
||||
|
||||
@@ -7,8 +7,8 @@ returns the item index of the currently selected item
|
||||
#### Usage:
|
||||
* Creates a default menubar with 3 entries selects the second entry and prints the currently selected index.
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aMenubar = mainFrame:addMenubar()
|
||||
local main = basalt.createFrame()
|
||||
local aMenubar = main:addMenubar()
|
||||
:addItem("1. Entry")
|
||||
:addItem("2. Entry",colors.yellow)
|
||||
:addItem("3. Entry",colors.yellow,colors.green)
|
||||
|
||||
@@ -7,8 +7,8 @@ Returns the current index offset
|
||||
#### Usage:
|
||||
* Creates a default menubar with 6 entries and sets the offset to 3, also prints the current offset.
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aMenubar = mainFrame:addMenubar()
|
||||
local main = basalt.createFrame()
|
||||
local aMenubar = main:addMenubar()
|
||||
:addItem("1. Entry")
|
||||
:addItem("2. Entry")
|
||||
:addItem("3. Entry")
|
||||
|
||||
@@ -10,8 +10,8 @@ Removes a item from the menubar
|
||||
#### Usage:
|
||||
* Creates a default menubar with 3 entries and removes the second one.
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aMenubar = mainFrame:addMenubar()
|
||||
local main = basalt.createFrame()
|
||||
local aMenubar = main:addMenubar()
|
||||
:addItem("1. Entry")
|
||||
:addItem("2. Entry",colors.yellow)
|
||||
:addItem("3. Entry",colors.yellow,colors.green)
|
||||
|
||||
@@ -10,8 +10,8 @@ selects a item in the menubar (same as a player would click on a item)
|
||||
#### Usage:
|
||||
* Creates a default menubar with 3 entries and selects the second entry.
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aMenubar = mainFrame:addMenubar()
|
||||
local main = basalt.createFrame()
|
||||
local aMenubar = main:addMenubar()
|
||||
:addItem("1. Entry")
|
||||
:addItem("2. Entry",colors.yellow)
|
||||
:addItem("3. Entry",colors.yellow,colors.green)
|
||||
|
||||
@@ -10,8 +10,8 @@ Sets the offset of the menubar (the same as you would scroll) - default is 0
|
||||
#### Usage:
|
||||
* Creates a default menubar with 6 entries and sets the offset to 3.
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aMenubar = mainFrame:addMenubar()
|
||||
local main = basalt.createFrame()
|
||||
local aMenubar = main:addMenubar()
|
||||
:addItem("1. Entry")
|
||||
:addItem("2. Entry")
|
||||
:addItem("3. Entry")
|
||||
|
||||
@@ -10,8 +10,8 @@ Makes it possible to scroll while the mouse is over the menubar
|
||||
#### Usage:
|
||||
* Creates a new menubar and makes it scrollable
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aMenubar = mainFrame:addMenubar():setScrollable(true)
|
||||
local main = basalt.createFrame()
|
||||
local aMenubar = main:addMenubar():setScrollable(true)
|
||||
:addItem("1. Entry")
|
||||
:addItem("2. Entry")
|
||||
:addItem("3. Entry")
|
||||
|
||||
@@ -11,8 +11,8 @@ Sets the background and the foreground of the item which is currently selected
|
||||
#### Usage:
|
||||
* Creates a default menubar with 4 entries and sets the selection background color to green.
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aMenubar = mainFrame:addMenubar()
|
||||
local main = basalt.createFrame()
|
||||
local aMenubar = main:addMenubar()
|
||||
:addItem("1. Entry")
|
||||
:addItem("2. Entry",colors.yellow)
|
||||
:addItem("3. Entry",colors.yellow,colors.green)
|
||||
|
||||
27
docs/objects/Menubar/setSpace.md
Normal file
27
docs/objects/Menubar/setSpace.md
Normal file
@@ -0,0 +1,27 @@
|
||||
## setSpace
|
||||
Sets the background and the foreground of the item which is currently selected
|
||||
|
||||
#### Parameters:
|
||||
1. `number` The space you want between the entries
|
||||
|
||||
#### Returns:
|
||||
1. `object` The object in use
|
||||
|
||||
#### Usage:
|
||||
* Creates a default menubar with 4 entries and sets the space to 3.
|
||||
```lua
|
||||
local main = basalt.createFrame()
|
||||
local aMenubar = main:addMenubar()
|
||||
:addItem("1. Entry")
|
||||
:addItem("2. Entry",colors.yellow)
|
||||
:addItem("3. Entry",colors.yellow,colors.green)
|
||||
:addItem("4. Entry")
|
||||
:setSpace(3)
|
||||
```
|
||||
```xml
|
||||
<menubar selectionBG="green" selectionFG="red" space="3">
|
||||
<item><text>1. Entry</text></item>
|
||||
<item><text>2. Entry</text><bg>yellow</bg></item>
|
||||
<item><text>2. Entry</text><bg>yellow</bg><fg>green</fg></item>
|
||||
</menubar>
|
||||
```
|
||||
Reference in New Issue
Block a user