Documentation

#BUTTON

BUTTON

Syntax: #BU id|number caption {commands}

Triggers the named or numbered button. This is typically assigned to a macro key. The number parameter can be a variable reference, but must evaluate to a numeric value. Instead of referring to a button by it's numeric position on the button bar, you can also refer to buttons by their ID name.

This command can also be used to define a button. This syntax is used by the ascii export and import scripting routines. If the number is zero, it refers to a button just past the last button, which is useful for appending a new button to the list. The syntax is:

#BUTTON id|number Off-caption On-command On-caption Off-command Value-expression Variable-name Bitmap-filename AutoSize Width Height AutoPos Top Left Off-color On-color Button-Kind Bitmap-margin Classname Options ToolTip ID PanelNum

For multi-state buttons On-caption, Off-command, and On-color can be string lists to represent the different states of the button.

BUTTON example

#BU 1
triggers the first button, just as if you had clicked it.

#BU test {Test Button} {look}
creates a new button, with an ID of "test", that sends the look command to the server when it is clicked

Description of all arguments

Here is description of each argument used in the full button creation command (used in Export and Import)

id|number
The numeric position of the button on the button bar, or the ID name of the button to modify

Off-caption

The text displayed on the button when it is off. For a multi-state button, this is the master caption for the button. This argument is subject to expansion, use quotes instead of braces if variable or function references are used.

On-command

The command to be executed when the button is clicked (when the button state changes to "on"). For a Menu button, this is the name of the menu class.

On-caption

For a toggle button, this text is displayed on the button when the button is pushed in (on). To create a multi-state button, use a string list to define the caption for each button state.

Off-command

For a toggle button, this command is executed when the button state changes to "off" (button clicked when it is down). For a multi-state button, this is a string list of commands corresponding to each button state.

Value-expression

This is the expression used to determine the button state. 0 is off, 1 is on. For multistate buttons, this numeric expression sets the button state. This allows the button state to be controlled from a script. For gauge buttons, this expression controls the value of the gauge.

Variable-name

The name of a variable to contain the state of the button. Whenever the button changes state, the current value of the button is written to this variable. Also, if this variable changes value in a script, the button state will change to reflect the new variable value.

Bitmap-filename

The name of the BMP image to display on the button. Instead of a BMP filename, this can also be the name of an internal resource bitmap.

AutoSize

If it is blank, then the AutoSize option is selected, and the values of the next two arguments are ignored.

Width

The width of the button in pixels. Only used if the AutoSize option is not selected.

Height

The height of the button in pixels. Only used if the AutoSize option is not selected.

AutoPos

If blank, then the AutoPosition option is selected, and the values of the next two arguments are ignored

Top

The top of the button in pixels. Only used if the AutoPos option is not selected.

Left

The left edge of the button in pixels. Only used if the AutoPos option is not selected.

Off-color

The color of the button when it is in the Off state. Also, the background color of a gauge button.

On-color

The color of the button when it is in the On state. For multistate buttons, this should be a string list of colors for each button state.

Button-kind

For separator buttons, this has the value of "Separ". For Menu buttons, this has the value of "Menu". For Gauge buttons, this argument is a string list. The first value of the string list is "Gauge". The second value of the string list is the Gauge normal color, the third value is the gauge low color, the 4th value is the GaugeMax expression, the 5th value is the GaugeLow expression..

Bitmap-margin

Indicates the spacing between the bitmap icon and the text caption. -1 is the default. Other negative values can be used to control the absolute position of the button on the button bar. If the bitmap is on top, the top position of the button is -(Margin+2). If the bitmap is on the left, the left position of the button is -(Margin+2).

Classname

The name of the class to assign this button to.

Options

A string list of various options. Value option values are: "explore" to set the explorer-style buttons, "inset" to draw an inset rectangle around the button, "stack" to stack this button with the previous one, "top" to display the icon on the top instead of to the left of the caption, "right" to set the button to be right-aligned.

Tooltip

The help tip displayed when the mouse hovers over the button.

ID

The ID name for the button

PanelNum
The panel number to display this button in. Value can be from 1 to 4. If omitted, the default value of 1 is used.

Add comment

Login or register to post comments