ToolButtons

From VisionaireWiki
Jump to navigation Jump to search

toolButtons

Adds a one or multiple button(s) to a toolbar.

The default-parent should be a toolbar. Otherwise the command tries to get the toolbar from the top-level window. The toolbar remains the default-parent after the button has been added.

Lua Syntax:

toolButtons({flags=1, 
    image = {"string1","string2",...}, 
    kind = "normal"|"check"|"radio"|"radiocheck", 
    helpShort = {"string1","string2",...}, 
    helpLong = {"string1","string2",...}, 
    action = {"string1","string2",...}, 
    deactivateAction = {"string1","string2",...}})

Arguments

Flags

i/image

Specifies an image-path of an image to be display on the toolbutton.

ki/kind

Specifies the kind of the toolbutton.
"normal"|"check"|"radio"|"radiocheck" - "normal": never stays pressed. "check": such tool stays pressed after it had been toggled. "radio": a checkable tool which makes part of a radio group of tools each of which is automatically unchecked whenever another button in the group is checked. "radiocheck": same as "radio" but additionally the tool can also be unchecked.

hs/helpShort

Specifies a short help text, used for tooltip.

hl/helpLong

Specifies a longer help text, used for status-bar.

a/action

Specifies a string with Lua source code to be executed when the toolbutton is activated.

da/deactivateAction

Specifies a string with Lua source code to be executed when the toolbutton is deactivated (only possible with kind "check" or "radiocheck".If the list contains only one string then this string is used for all buttons.

Return Values

true
Button created.
false
No button created because current default-parent is not a toolbar and top-level window doesn't have a toolbar either.
None
Command failed because default-parent is empty.