{<name>:} radio_box {<strings>}
Radio_box sub-panel. A layout of options each with an indicator button. One option may be selected at a time. Options can be text or image.
Panel window
Tab window
Table window
<name>
A name to be given to the sub-panel for reference purposes.
<strings>
The text (labels) to appear alongside the diamond-shaped toggle indicators in the radio
box. They can be omitted when the options are to be shown in image form.
-bc=<color>
The background color for the options. When the radio box has options in image
form, a value of no_change will use the color
of the sub-panel’s parent window. This is applicable to transparent image
files only. For text radio boxes, the background color of the parent window
is used and cannot be changed.
-cr=<file(s)>
Display a raster image. This can be the name of one image file containing many cameos, or more
when images from different files are required. Multiple files should be
comma-separated all enclosed within < and >.
-d=<num>
The default option to be initially selected in the one-of-many radio box. If omitted,
option one is selected. A value of 0 will leave all options initially
deselected.
-dim=<screen_xy>
Define the dimensions of the sub-panel in pixels. This is usually redundant
because radio boxes are by default created sized-to-fit, but is useful
when the size needs to be overridden. This is a two-element numeric array
providing width and height. If only one is required, the other can be
set to -1 and will be ignored.
-fc=<color>
The foreground color for the images. This is applicable to monochrome images
only.
-fo=<font>
The font to be used for option text. This must be a fixed font. If omitted
the radio box inherits the font of its parent row or column. This is ignored
for image menus.
-fra
Enclose the radio box by a frame. The default behavior is not to.
-g=<num>
The spacing between options. The default is 4.
-gh
The radio box should be initially ghosted, i.e. insensitive to user-interaction.
-h
Display the options horizontally. The default is vertical.
-inv
Make the sub-panel invisible on creation.
-j=<just>
The justification of the radio box within its parent row or column. Within a parent row
the value should be one of L, M, R. Within a parent column the value should
be one of T, M or B. The default in both cases is M.
-link=<text>
The resize linkage for the panel. This ties panel edges to one or more edges of the parent
window, with the result that when the parent window gets resized, the
panel gets automatically resized as well. <text>
is a combination of the characters L, R, T, B and M. A value of "LRTB"
means that the left, right, top and bottom edges of a sub-panel are linked
to its parent. The default value is "TL", which links the left
and top edges to the parent window but does no resizing because its right
and bottom edges are not linked. Note that the linkage is to edges of
the parent window, not to column/row extremities. More complicated linkage
requirements should be done via the window.resize
callback on the parent window.
-pj=<just>
The position justification of the sub-panel within the panel window. This combined
with the -x and -y switches
can be used to position the sub-panel by one of its corners. The default
is ’TL’. It also defines the control point to be used when repositioning
the sub-panel after creation.
-res=<num>
Used in conjunction with the -cr switch, this defines
a scaling factor for the image. For example, a value of 0.5 will show the image half-size.
-t=<strings>
User-defined strings which can be used as values corresponding to options, e.g when
the options are in image form. There should be as many elements in <strings>
as there options. The default values are the radio box labels.
-tc=<color>
The color for text in the radio box. If omitted the parent window "other
color" is used.
-th=<num>
Draw a border of width <num>
pixels around each image in the radio box. The color used is the parent
window "other color". This is ignored for text radio boxes.
-tt=<string>
A tooltip to appear when the user rests the mouse cursor over the panel.
Concatenating text with
a '|' separator enables different tooltips to be set for individual options.
Without '|' concatenation the tooltip will be applied to the whole panel.
-x=<num>
The x position of the sub-panel relative to the top-left corner of its parent
row or column. If omitted, the sub-panel is placed adjacent to the previously
defined sub-panel.
-y=<num>
The y position of the sub-panel relative to the top-left corner of its parent
row or column. If omitted, the sub-panel is placed below the previously
defined sub-panel.
Called when the selected option changes.
<panel>.exec(<window>,<panel>{,<row>})
Panel/Tab Window
panel.exec { args w=window, p=panel }
Table Window
panel.exec { args w=window, p=panel, row=numeric }
Switches -j, -pj, -x and -y apply only to radio boxes within a panel window. Radio boxes within other windows cannot have a user-defined position or justification.
Create a panel window containing a radio-box of text items in a specified font.
window w = wpanel { dev: radio_box -fo=big_xfont,\ <'Dat','CD','Diskette','QIC','Exabyte'> }
Create a similar panel window to the previous example but with the radio-box framed, a different text color, no initial value, "quiet" mode, and a "set" color of red.
window w = wpanel { dev: radio_box -tc=white,-d=0,-q,-set=red,\ <'Dat','CD','Diskette','QIC','Exabyte'> }
Create a panel window containing a radio-box with image options. The options have associated text values. The background color of the images is made the same as that of the radio-box. The options are laid out horizontally. states.ras is assumed to be a image file containing four cameos. Individual option tooltips are supplied.
window w = wpanel { state: radio_box -cr='states.ras',-bc=no_change,\ -h,-t=<'NY','FLA','LA','COL'>,\ -tt='New York|Florida|Louisiana|Colorado' }
Create a similar panel window to the previous example but with the images named individually to illustrate multiple image definition.
window w = wpanel { state: radio_box \ -cr=<'newyork.gif','florida.gif',\ 'louisiana.gif','colorado.gif'>,\ -bc=no_change,-h,-t=<'NY','FLA','LA','COL'> }