Some docs updates

This commit is contained in:
Robert Jelic
2022-08-30 20:49:25 +02:00
parent c977410a41
commit 2dd3bf648b
22 changed files with 181 additions and 131 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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")

View File

@@ -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)

View File

@@ -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)

View File

@@ -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")

View File

@@ -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")

View File

@@ -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)

View 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>
```