1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1995 DSC Technologies Corporation
|
3 |
|
|
'\"
|
4 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
5 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
6 |
|
|
'\"
|
7 |
|
|
'\" @(#) selectionbox.n 1.21 94/12/17 16:04:44
|
8 |
|
|
'/"
|
9 |
|
|
.so man.macros
|
10 |
|
|
.HS selectionbox iwid
|
11 |
|
|
.BS
|
12 |
|
|
'\" Note: do not modify the .SH NAME line immediately below!
|
13 |
|
|
.SH NAME
|
14 |
|
|
selectionbox \- Create and manipulate a selection box widget
|
15 |
|
|
.SH SYNOPSIS
|
16 |
|
|
\fBselectionbox\fI \fIpathName \fR?\fIoptions\fR?
|
17 |
|
|
.SH "INHERITANCE"
|
18 |
|
|
itk::Widget <- selectionbox
|
19 |
|
|
.SH "STANDARD OPTIONS"
|
20 |
|
|
.LP
|
21 |
|
|
.nf
|
22 |
|
|
.ta 4c 8c 12c
|
23 |
|
|
\fBactiveBackground\fR \fBbackground\fR \fBborderWidth\fR \fBcursor\fR
|
24 |
|
|
\fBexportSelection\fR \fBforeground\fR \fBhighlightColor\fR \fBhighlightThickness\fR
|
25 |
|
|
\fBinsertBackground\fR \fBinsertBorderWidth\fR \fBinsertOffTime\fR \fBinsertOnTime\fR
|
26 |
|
|
\fBinsertWidth\fR \fBrelief\fR \fBrepeatDelay\fR \fBrepeatInterval\fR
|
27 |
|
|
\fBselectBackground\fR \fBselectBorderWidth\fR \fBselectForeground\fR
|
28 |
|
|
.fi
|
29 |
|
|
.LP
|
30 |
|
|
See the "options" manual entry for details on the standard options.
|
31 |
|
|
.SH "ASSOCIATED OPTIONS"
|
32 |
|
|
.LP
|
33 |
|
|
.nf
|
34 |
|
|
.ta 4c 8c 12c
|
35 |
|
|
\fBtextBackground\fR \fBtextFont\fR
|
36 |
|
|
.fi
|
37 |
|
|
.LP
|
38 |
|
|
See the "entryfield" widget class manual entry for details on the above
|
39 |
|
|
associated options.
|
40 |
|
|
.LP
|
41 |
|
|
.nf
|
42 |
|
|
.ta 4c 8c 12c
|
43 |
|
|
\fBlabelFont\fR \fBlabelMargin\fR
|
44 |
|
|
.fi
|
45 |
|
|
.LP
|
46 |
|
|
See the "labeledwidget" class manual entry for details on the above
|
47 |
|
|
associated options.
|
48 |
|
|
.LP
|
49 |
|
|
.nf
|
50 |
|
|
.ta 4c 8c 12c
|
51 |
|
|
\fBactiveRelief\fR \fBelementBorderWidth\fR \fBjump\fR \fBtroughColor\fR
|
52 |
|
|
.fi
|
53 |
|
|
.LP
|
54 |
|
|
See the "scrollbar" widget class manual entry for details on the above
|
55 |
|
|
associated options.
|
56 |
|
|
.LP
|
57 |
|
|
.nf
|
58 |
|
|
.ta 4c 8c 12c
|
59 |
|
|
\fBdblClickCommand\fR \fBhscrollMode\fR \fBsbWidth\fR \fBscrollMargin\fR
|
60 |
|
|
\fBtextBackground\fR \fBtextFont\fR \fBvscrollMode\fR
|
61 |
|
|
.fi
|
62 |
|
|
.LP
|
63 |
|
|
See the "scrolledlistbox" widget class manual entry for details on the above
|
64 |
|
|
associated options.
|
65 |
|
|
|
66 |
|
|
.SH "WIDGET-SPECIFIC OPTIONS"
|
67 |
|
|
.LP
|
68 |
|
|
.nf
|
69 |
|
|
Name: \fBchildSitePos\fR
|
70 |
|
|
Class: \fBPosition\fR
|
71 |
|
|
Command-Line Switch: \fB-childsitepos\fR
|
72 |
|
|
.fi
|
73 |
|
|
.IP
|
74 |
|
|
Specifies the position of the child site in the selection box: \fBn\fR,
|
75 |
|
|
\fBs\fR, \fBe\fR, \fBw\fR, or \fB\fR. The default is center
|
76 |
|
|
.LP
|
77 |
|
|
.nf
|
78 |
|
|
Name: \fBheight\fR
|
79 |
|
|
Class: \fBHeight\fR
|
80 |
|
|
Command-Line Switch: \fB-height\fR
|
81 |
|
|
.fi
|
82 |
|
|
.IP
|
83 |
|
|
Specifies the height of the selection box. The value may be specified in
|
84 |
|
|
any of the forms acceptable to Tk_GetPixels. The default is 320 pixels.
|
85 |
|
|
.LP
|
86 |
|
|
.nf
|
87 |
|
|
Name: \fBitemsCommand\fR
|
88 |
|
|
Class: \fBCommand\fR
|
89 |
|
|
Command-Line Switch: \fB-itemscommand\fR
|
90 |
|
|
.fi
|
91 |
|
|
.IP
|
92 |
|
|
Specifies a command to be evaluated following selection of an item.
|
93 |
|
|
.LP
|
94 |
|
|
.nf
|
95 |
|
|
Name: \fBitemsLabel\fR
|
96 |
|
|
Class: \fBText\fR
|
97 |
|
|
Command-Line Switch: \fB-itemslabel\fR
|
98 |
|
|
.fi
|
99 |
|
|
.IP
|
100 |
|
|
Specifies the text of the label for the items list. The default is "List".
|
101 |
|
|
.LP
|
102 |
|
|
.nf
|
103 |
|
|
Name: \fBitemsLabelPos\fR
|
104 |
|
|
Class: \fBPosition\fR
|
105 |
|
|
Command-Line Switch: \fB-itemslabelpos\fR
|
106 |
|
|
.fi
|
107 |
|
|
.IP
|
108 |
|
|
Specifies the position of the label along the side of the items
|
109 |
|
|
list: \fBn\fR, \fBne\fR, \fBe\fR, \fBse\fR, \fBs\fR, \fBsw\fR, \fBw\fR,
|
110 |
|
|
or \fBnw\fR. The default is nw.
|
111 |
|
|
.LP
|
112 |
|
|
.nf
|
113 |
|
|
Name: \fBitemsOn\fR
|
114 |
|
|
Class: \fBItemsOn\fR
|
115 |
|
|
Command-Line Switch: \fB-itemson\fR
|
116 |
|
|
.fi
|
117 |
|
|
.IP
|
118 |
|
|
Specifies whether or not to display the items list in any
|
119 |
|
|
of the forms acceptable to \fBTcl_GetBoolean\fR. The default is true.
|
120 |
|
|
.LP
|
121 |
|
|
.nf
|
122 |
|
|
Name: \fBmargin\fR
|
123 |
|
|
Class: \fBMargin\fR
|
124 |
|
|
Command-Line Switch: \fB-margin\fR
|
125 |
|
|
.fi
|
126 |
|
|
.IP
|
127 |
|
|
Specifies distance between the items list and selection entry in any of
|
128 |
|
|
the forms acceptable to \fBTk_GetPixels\fR. The default is 7 pixels.
|
129 |
|
|
.LP
|
130 |
|
|
.nf
|
131 |
|
|
Name: \fBselectionCommand\fR
|
132 |
|
|
Class: \fBCommand\fR
|
133 |
|
|
Command-Line Switch: \fB-selectioncommand\fR
|
134 |
|
|
.fi
|
135 |
|
|
.IP
|
136 |
|
|
Specifies a Tcl procedure to be associated with a return key press event
|
137 |
|
|
in the selection entry field.
|
138 |
|
|
.LP
|
139 |
|
|
.nf
|
140 |
|
|
Name: \fBselectionLabel\fR
|
141 |
|
|
Class: \fBText\fR
|
142 |
|
|
Command-Line Switch: \fB-selectionlabel\fR
|
143 |
|
|
.fi
|
144 |
|
|
.IP
|
145 |
|
|
Specifies the text of the label for the selection entry field. The default
|
146 |
|
|
is "Selection".
|
147 |
|
|
.LP
|
148 |
|
|
.nf
|
149 |
|
|
Name: \fBselectionLabelPos\fR
|
150 |
|
|
Class: \fBPosition\fR
|
151 |
|
|
Command-Line Switch: \fB-selectionlabelpos\fR
|
152 |
|
|
.fi
|
153 |
|
|
.IP
|
154 |
|
|
Specifies the position of the label along the side of the selection:
|
155 |
|
|
\fBn\fR, \fBne\fR, \fBe\fR, \fBse\fR, \fBs\fR, \fBsw\fR, \fBw\fR,
|
156 |
|
|
or \fBnw\fR. The default is nw.
|
157 |
|
|
.LP
|
158 |
|
|
.nf
|
159 |
|
|
Name: \fBselectionOn\fR
|
160 |
|
|
Class: \fBSelectionOn\fR
|
161 |
|
|
Command-Line Switch: \fB-selectionon\fR
|
162 |
|
|
.fi
|
163 |
|
|
.IP
|
164 |
|
|
Specifies whether or not to display the selection entry in any
|
165 |
|
|
of the forms acceptable to \fBTcl_GetBoolean\fR. The default is true.
|
166 |
|
|
.LP
|
167 |
|
|
.nf
|
168 |
|
|
Name: \fBwidth\fR
|
169 |
|
|
Class: \fBWidth\fR
|
170 |
|
|
Command-Line Switch: \fB-width\fR
|
171 |
|
|
.fi
|
172 |
|
|
.IP
|
173 |
|
|
Specifies the width of the selection box. The value may be specified in
|
174 |
|
|
any of the forms acceptable to Tk_GetPixels. The default is 260 pixels.
|
175 |
|
|
.LP
|
176 |
|
|
.BE
|
177 |
|
|
|
178 |
|
|
.SH DESCRIPTION
|
179 |
|
|
.PP
|
180 |
|
|
The \fBselectionbox\fR command creates a scrolled list of items and
|
181 |
|
|
a selection entry field. The user may choose any of the items displayed
|
182 |
|
|
in the scrolled list of alternatives and the selection field will be
|
183 |
|
|
filled with the choice. The user is also free to enter a new value in
|
184 |
|
|
the selection entry field. Both the list and entry areas have labels.
|
185 |
|
|
A child site is also provided in which the user may create other widgets
|
186 |
|
|
to be used in conjunction with the selection box.
|
187 |
|
|
|
188 |
|
|
.SH "METHODS"
|
189 |
|
|
.PP
|
190 |
|
|
The \fBselectionbox\fR command creates a new Tcl command whose
|
191 |
|
|
name is \fIpathName\fR. This
|
192 |
|
|
command may be used to invoke various
|
193 |
|
|
operations on the widget. It has the following general form:
|
194 |
|
|
.DS C
|
195 |
|
|
\fIpathName option \fR?\fIarg arg ...\fR?
|
196 |
|
|
.DE
|
197 |
|
|
\fIOption\fR and the \fIarg\fRs
|
198 |
|
|
determine the exact behavior of the command.
|
199 |
|
|
|
200 |
|
|
.SH "ASSOCIATED METHODS"
|
201 |
|
|
.LP
|
202 |
|
|
.nf
|
203 |
|
|
.ta 4c 8c 12c
|
204 |
|
|
\fBcurselection\fR \fBdelete\fR \fBindex\fR \fBnearest\fR
|
205 |
|
|
\fBscan\fR \fBselection\fR \fBsize\fR
|
206 |
|
|
.fi
|
207 |
|
|
.LP
|
208 |
|
|
See the "listbox" widget class manual entry for details on the
|
209 |
|
|
associated methods.
|
210 |
|
|
|
211 |
|
|
.SH "WIDGET-SPECIFIC METHODS"
|
212 |
|
|
.TP
|
213 |
|
|
\fIpathName \fBcget\fR \fIoption\fR
|
214 |
|
|
Returns the current value of the configuration option given
|
215 |
|
|
by \fIoption\fR.
|
216 |
|
|
\fIOption\fR may have any of the values accepted by the \fBselectionbox\fR
|
217 |
|
|
command.
|
218 |
|
|
.TP
|
219 |
|
|
\fIpathName \fBchildsite\fR
|
220 |
|
|
Returns the child site widget path name.
|
221 |
|
|
.TP
|
222 |
|
|
\fIpathName \fBclear\fR \fIcomponent\fR
|
223 |
|
|
Delete the contents of either the selection entry widget or
|
224 |
|
|
items list. The \fIcomponent\fR argument may be either \fBitems\fR
|
225 |
|
|
or \fBselection\fR.
|
226 |
|
|
.TP
|
227 |
|
|
\fIpathName\fR \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
|
228 |
|
|
Query or modify the configuration options of the widget.
|
229 |
|
|
If no \fIoption\fR is specified, returns a list describing all of
|
230 |
|
|
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
|
231 |
|
|
information on the format of this list). If \fIoption\fR is specified
|
232 |
|
|
with no \fIvalue\fR, then the command returns a list describing the
|
233 |
|
|
one named option (this list will be identical to the corresponding
|
234 |
|
|
sublist of the value returned if no \fIoption\fR is specified). If
|
235 |
|
|
one or more \fIoption\-value\fR pairs are specified, then the command
|
236 |
|
|
modifies the given widget option(s) to have the given value(s); in
|
237 |
|
|
this case the command returns an empty string.
|
238 |
|
|
\fIOption\fR may have any of the values accepted by the \fBselectionbox\fR
|
239 |
|
|
command.
|
240 |
|
|
.TP
|
241 |
|
|
\fIpathName \fBget\fR
|
242 |
|
|
Returns the current value of the selection entry widget.
|
243 |
|
|
.TP
|
244 |
|
|
\fIpathName \fBinsert\fR \fIcomponent\fR \fIargs\fR
|
245 |
|
|
Insert element(s) into either the selection entry widget or
|
246 |
|
|
items list. The \fIcomponent\fR argument may be either \fBitems\fR
|
247 |
|
|
or \fBselection\fR. The \fIargs\fR follow the rules of either an entry
|
248 |
|
|
or list widget depending on the \fIcomponent\fR value.
|
249 |
|
|
.TP
|
250 |
|
|
\fIpathName \fBselectitem\fR
|
251 |
|
|
Replace the selection entry field contents with the currently
|
252 |
|
|
selected items value.
|
253 |
|
|
|
254 |
|
|
.SH "COMPONENTS"
|
255 |
|
|
.LP
|
256 |
|
|
.nf
|
257 |
|
|
Name: \fBchildsite\fR
|
258 |
|
|
Class: \fBFrame\fR
|
259 |
|
|
.fi
|
260 |
|
|
.IP
|
261 |
|
|
The childsite component is the user child site for the selection box. See
|
262 |
|
|
the "frame" widget manual entry for details on the childsite component item.
|
263 |
|
|
.LP
|
264 |
|
|
.nf
|
265 |
|
|
Name: \fBitems\fR
|
266 |
|
|
Class: \fBScrolledlistbox\fR
|
267 |
|
|
.fi
|
268 |
|
|
.IP
|
269 |
|
|
The items component provides the scrolled list box of items for the selection
|
270 |
|
|
box. See the "scrolledlistbox" widget manual entry for details on the
|
271 |
|
|
items component item.
|
272 |
|
|
.LP
|
273 |
|
|
.nf
|
274 |
|
|
Name: \fBselection\fR
|
275 |
|
|
Class: \fBEntryfield\fR
|
276 |
|
|
.fi
|
277 |
|
|
.IP
|
278 |
|
|
The selection component provides the entry field in the selection box for
|
279 |
|
|
display of the selected item in the items component. See the "entryfield"
|
280 |
|
|
widget manual entry for details on the selection component item.
|
281 |
|
|
.fi
|
282 |
|
|
|
283 |
|
|
.SH EXAMPLE
|
284 |
|
|
.DS
|
285 |
|
|
option add *textBackground white
|
286 |
|
|
|
287 |
|
|
selectionbox .sb -items {Hello {Out There} World}
|
288 |
|
|
pack .sb -padx 10 -pady 10 -fill both -expand yes
|
289 |
|
|
|
290 |
|
|
set cs [label [.sb childsite].label -text "Child Site"]
|
291 |
|
|
pack $cs -fill x -padx 10 -pady 10
|
292 |
|
|
|
293 |
|
|
.sb insert items 2 {Cruel Cruel}
|
294 |
|
|
|
295 |
|
|
.sb selection set 1
|
296 |
|
|
.DE
|
297 |
|
|
.SH AUTHOR
|
298 |
|
|
Mark L. Ulferts
|
299 |
|
|
.SH KEYWORDS
|
300 |
|
|
selectionbox, widget
|