{<name>:} combo_box { <strings> }
Combination sub-panel comprising a text input box and pulldown menu with selectable options.
Panel window
Tab window
Table window
<name>
A name to be given to the sub-panel for reference purposes.
<string>
The text (labels) to appear in the pulldown menu.
-bc=<color>
The background color for the text box. If omitted, the background color of
the parent window is used.
-c=<num>
The width of the text box in characters. If omitted, a suitable default is computed
from the values in the pulldown menu.
-d=<string>
The default text to appear in the text input box. If omitted, an empty string
is displayed.
-dim=<screen_xy>
Define the dimensions of the sub-panel in pixels. This is usually redundant
because combo 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.
-er
Extend the width of the sub-panel to the right of its parent row or
column.
-fo=<font>
The font to be used for the text. This must be a fixed font. If omitted
the combo box inherits the font of its parent row or column.
-gh
The sub-panel should be initially ghosted, i.e. insensitive to user-interaction.
-inv
Make the sub-panel invisible on creation.
-j=<just>
The justification
of the combo 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.
-lim=<num>
The maximum number of characters which can be input /displayed in the text box.
-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.
-tc=<color>
The color for text in the combo box. If omitted the parent window "other
color" is used.
-w=<num>
The width of the text box in pixels. If omitted, the width will be sized to fit.
-x=<num>
The x position of the combo box relative to the top-left corner of its parent
row or column. If omitted, the combo box is placed adjacent to the previously
defined sub-panel.
-y=<num>
The y position of the combo box relative to the top-left corner of its parent
row or column. If omitted, the combo box is placed below the previously
defined sub-panel.
Called as the combo box is about to lose the keyboard focus. If a non-empty after callback exists for the panel, the focus remains with the panel until directed elsewhere by a focus command.
<panel>.after(<window>,<panel>{,<row>})
Panel/Tab Window
panel.after { args w=window, p=panel }
Table Window
panel.after { args w=window, p=panel, row=numeric }
Called as the combo box receives the keyboard focus.
<panel>.before(<window>,<panel>{,<row>})
Panel/Tab Window
panel.before { args w=window, p=panel }
Table Window
panel.before { args w=window, p=panel, row=numeric }
Called when an option is picked from the pulldown menu, or when <Return> is hit in the text box.
<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 combo boxes within a panel window. Combo boxes within other windows cannot have a user-defined position or justification.
Create a panel window containing a labeled combo-box of specified font and character width.
window w = wpanel { row { label 'Fruit:' fruit: combo_box -fo=big_xfont,-c=10,\ <'Apple','Jack','Melon','Orange','Ugly'> } }
Create a panel window containing a labeled combo-box of specified colors. It is given an initial value.
window w = wpanel { row { label 'City:' city: combo_box -tc=red,-bc=yellow,-d='Dallas',\ <'Delhi','Kinshasa','Lima','Seattle','Seoul'> } }