Toolbox

From VisionaireWiki
Jump to: navigation, search

toolbox

Creates a toolbox-control.

The toolbox can host one or more tools for modification of sprites, rectangles etc. It can't have child-controls, so the current default-parent remains unaltered.

Lua Syntax:

toolbox( [windowName, object], {flags=1, 
    edit = true|false, 
    image = int, 
    zoom = -1|0|1, 
    clear = true|false, 
    transparentBackground = true|false, 
    backgroundSize = {x=int,y=int}, 
    position = {x=int,y=int}, 
    size = {x=int,y=int}, 
    border = "[lrtb] width", 
    align = "left"|"right"|"center"|"top"|"bottom", 
    expand = "shaped", 
    proportion = int})

Arguments

windowName

"string" - Name of the new toolbox.

object

"object path"|"object id"|object - Specifies an object to work on.

Flags

e/edit

If true then edit an existing toolbox.

i/image

Specifies the data-field holding the background-image which will be used for the toolbox.

zo/zoom

Sets the zoom level for the toolbox.
-1|0|1 - -1... zoom out, 0... set zoom level to 100%, +1... zoom in

clr/clear

If specified and set to true then all tools of the toolbox will be removed.

tbg/transparentBackground

If specified and set to true then a special checked pattern is shown where the background is transparent.

bgs/backgroundSize

Specifies the size of the background used for this tool box. Setting this size makes only sense if the tool box is not linked to an image.

pos/position

Specifies the position of the window.

sz/size

Specifies the size of the window.

b/border

This flag specifies to which side(s) of the control a border will be applied to.
"[lrtb] width" - First group is a string combining characters standing for 'left', 'right', 'top' and 'bottom' side.After a space the width of the border in pixel is specified.

al/align

Specifies the alignment of the item within the space allotted to it by the layout.
"left"|"right"|"center"|"top"|"bottom" - Alignment of control. Top- and bottom-align only makes sense in a row-layout, left- and right-align in a column layout.

exp/expand

Specifies whether the item will be expanded to fill the space assigned to the item.
"shaped" - With this argument the item will be expanded as much as possible while also maintaining its aspect ratio

p/proportion

Used in row- and column-layout to indicate if a child of a layout can change its size in the main orientation of the layout - where 0 stands for not changeable and a value of more than zero is interpreted relative to the value of other children of the same layout.

Return Values

String
Name of the new toolbox.
None
Command failed because default-parent was empty.