ProvideX V8.20 > Language Reference > 2. Directives
34
BUTTON Directive
          Control Button
Formats
1. Define/Create: BUTTON [*]ctl_id,@(col,ln,wth,ht)=contents$[,ctrlopt]
2. Remove: BUTTON REMOVE [*]ctl_id[,ERR=stmtref]
3. Disable/Enable: BUTTON {DISABLE | ENABLE} [*]ctl_id[,ERR=stmtref]
4. Hide/Show: BUTTON {HIDE | SHOW} [*]ctl_id[,ERR=stmtref]
5. Force Focus: BUTTON GOTO [*]ctl_id[,ERR=stmtref]
6. Signal on Focus: BUTTON SET_FOCUS [*]ctl_id,ctl_val[,ERR=stmtref]
7. Logical Push, Release: BUTTON {ON | OFF} [*]ctl_id[,ERR=stmtref]
8. Read Activation Mode: BUTTON READ [*]ctl_id,mode$[,ERR=stmtref]
Where
*
Optional. Use a leading asterisk to denote a global button.
@(col,ln,
Position and size of the button region. Numeric expressions. Column and
wth,ht)
line coordinates for top left corner, width in number of columns and height
in number of lines. Use line value -1 to display the button on the tool bar.
contents$ Text/images to appear on the button. See BUTTON contents$, p.36
ctl_id
Unique logical identifier for the button (any integer -32000 to +32000). Avoid
integers that conflict with keyboard definitions (e.g., 4 cancels CTL=4 for the
F4 key) or Negative CTL Definitions, p.822. Use this value with the
apostrophe operator to access various Button Properties.
Control options. Supported options for BUTTON include:
ctrlopt
ERR=stmtref Error transfer
FNT="font,size[,attr]" Font name, size, optional properties
Refer to the 'FONT' Mnemonic, p.607 for details.
MSG=text$ Message string.
MNU=ctl CTL value associated with right-click menu event
OWN=name$ Name assigned for automated testing of this control
OPT=char$ (See BUTTON OPT= Settings)
TIP=text$ Mouse pointer message
To change the colour, refer to the 'TC'= System Parameter, p.686.
ctl_val
CTL value to generate when focus goes to button.
mode$
String variable. ProvideX returns a single-character hex value in this
variable to report the last method / keystroke the user chose to activate
the button ($01$ for MOUSE-CLICK or $0D$ for Enter ).
stmtref
Program line number or label to transfer control to.
BUTTON OPT= Settings
Available attribute/behaviour settings are listed below. Some characters may be
combined. Invalid settings are ignored.
Bitmap Left. Places bitmap left of text.
"<"