Character windows - buttons¶
Activating buttons
In order to hold a push button down under character windows (where the mouse cannot be used) press the PAGE DOWN key to push the button down, followed by the PAGE UP key to release it.
Pressing a button’s hotkey brings the button into focus (the ALT key is not required).
Extra properties
border = integer
shadow = integer
|
Border and shadow style. These properties may be applied to individual buttons or to button groups. The default border and shadow styles are those defined in Section 11 of the terminal parameter file for buttons in the palette. Different border and shadow defaults may be defined for push buttons and multi buttons. |
Button image
Images cannot be used for buttons under character windows. If a program containing image buttons is intended for use with character windows, it may be practical to assign different clauses at run time according to whether the program is being run under character windows or GUI. This is achieved by use of the function users(5) as shown in this example:
-button SmartButton at 45,128 {
... common clauses...
}
switch (users(5)) {
case = "WINDOWS":
SmartButton->property = value
...
break
default :
SmartButton->property = value
...
break
}
create SmartButton
If an image button has a border, this is only used in character windows mode.
Button palette
Palette 9 (PAL_LARGE_BUTTON) is provided for creating a large push-style button. Use it in conjunction with the style flag WS_STANDOUT to gain the desired effect.
RELATED TOPICS |
Button size
width = integer |
Width of the button in columns. Border and shadow, if specified, occupy additional columns. If a program with image buttons is run under character windows, the label length determines the button width. Default: Push buttons, width of label. Radio and checkbox buttons, width of label + width of checkbox data + 1. |
height = integer |
Height of the button in rows. If the button height is 3 or greater, this height is deemed to include the border if the button has a border. Default: 1 |
RELATED TOPICS |
Button style
The following extra button style is available:
WS_STANDOUT
Standout border. Use to give push buttons a 3-D appearance. This flag can be used in conjunction with the border style SINGLE_LINE to create a 3D push button.
Checkbox groups
The appearance of the a checkbox button’s checkbox is definable. The character or characters to be displayed when the button is in a checked and unchecked state are stored in the terminal parameter file, Section 7, Entry 2, Sub-entries 1 and 2. In this example, an unchecked button has been set to display as “[ ]” and a checked button to “[X]”.
[X] BOLD
[ ] REVERSE
[X] ITALIC
Radio groups
The appearance of radio buttons is definable. The character or characters to be displayed when the button is in a checked and unchecked state are stored in the terminal parameter file, Section 7, Entry 2, Sub-entries 3 and 4. In this example, unchecked buttons have been set to display as “[-]” and the checked button as “[o]”.
[-] GREEN
[o] BLUE
[-] RED
RELATED TOPICS |