OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [man/] [TixComboBox.html] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
 
2
 
3
 
4
<TITLE>tixComboBox - Create and manipulate tixComboBox widgets</TITLE>
5
<Center><H2>tixComboBox - Create and manipulate tixComboBox widgets</H2></Center><hr>
6
 
7
<P>
8
</pre><H3>SYNOPSIS</H3>
9
<B>tixComboBox<I> <I>pathName ?<I>options</I></B>?
10
<P>
11
</pre><H3>SUPER-CLASS</H3>
12
The <B>TixComboBox</B></I> class is derived from the <B>TixLabelWidget</B></I>
13
class and inherits all the commands, options and subwidgets
14
of its super-class.
15
</pre><H3>STANDARD OPTIONS</H3>
16
<B>TixComboBox</B></I> supports all the standard options of a frame widget.
17
See the options(n) manual entry for details on the standard options.
18
<P>
19
</pre><H3>WIDGET-SPECIFIC OPTIONS</H3>
20
<P>
21
<pre><code><code><code>
22
Name:           <B>anchor</B></I>
23
Class:          <B>Anchor</B></I>
24
Switch:         <B>-anchor</B></I>
25
</code></code></code></pre>
26
<UL>
27
Specifies how the string inside the entry subwidget should be aligned.
28
Only the values "w" or "e" are allowed. When set the "w", the entry is
29
aligned to its beginning. When set to "e", it is aligned to its end.
30
</UL>
31
<P>
32
<pre><code><code><code>
33
Name:           <B>arrowBitmap</B></I>
34
Class:          <B>ArrowBitmap</B></I>
35
Switch:         <B>-arrowbitmap</B></I>
36
</code></code></code></pre>
37
<UL>
38
Specifies the bitmap to be used in the arrow button beside the entry
39
widget. The default is an downward arrow bitmap in the file
40
$tix_library/bitmaps/cbxarrow
41
</UL>
42
<P>
43
<pre><code><code><code>
44
Name:           <B>browseCmd</B></I>
45
Class:          <B>BrowseCmd</B></I>
46
Switch:         <B>-browsecmd</B></I>
47
</code></code></code></pre>
48
<UL>
49
Specifies the command to be called when the user browses through the
50
listbox. This command can be used to provide instant feedback when the
51
user examines items in the listbox before committing a choice.
52
</UL>
53
<P>
54
<pre><code><code><code>
55
Name:           <B>command</B></I>
56
Class:          <B>Command</B></I>
57
Switch:         <B>-command</B></I>
58
</code></code></code></pre>
59
<UL>
60
Specifies the command to be called when the ComboBox is invoked
61
or when the <B>-value</B></I> of the ComboBox is changed.
62
</UL>
63
<P>
64
<pre><code><code><code>
65
Name:           <B>crossBitmap</B></I>
66
Class:          <B>CrossBitmap</B></I>
67
Switch:         <B>-crossbitmap</B></I>
68
</code></code></code></pre>
69
<UL>
70
Specifies the bitmap to be used in the "cross" button to the left of
71
the entry widget. The default is a bitmap in the file
72
$tix_library/bitmaps/cross
73
</UL>
74
<P>
75
<pre><code><code><code>
76
Name:           <B>disableCallback</B></I>
77
Class:          <B>DisableCallback</B></I>
78
Switch:         <B>-disablecallback</B></I>
79
</code></code></code></pre>
80
<UL>
81
A boolean value indicating whether callbacks should be disabled. When
82
set to true, the TCL command specified by the <B>-command</B></I> option
83
is not executed when the <B>-value</B></I> of the ComboBox.
84
changes.
85
</UL>
86
<P>
87
<pre><code><code><code>
88
Name:           <B>disabledforeground</B></I>
89
Class:          <B>DisabledForeground</B></I>
90
Switch:         <B>-disabledforeground</B></I>
91
</code></code></code></pre>
92
<UL>
93
Specifies the foreground color to be used when the ComboBox is disabled.
94
</UL>
95
<P>
96
<pre><code><code><code>
97
Name:           <B>dropdown</B></I>
98
Class:          <B>Dropdown</B></I>
99
Switch:         <B>-dropdown</B></I>
100
</code></code></code></pre>
101
<UL>
102
A Boolean value specifying the style of the ComboBox. When set to
103
"true", the listbox is only displayed temporarily when the arrow
104
button is pressed. When set to "false", the listbox is always
105
displayed.
106
</UL>
107
<P>
108
<pre><code><code><code>
109
Name:           <B>editable</B></I>
110
Class:          <B>Editable</B></I>
111
Switch:         <B>-editable</B></I>
112
</code></code></code></pre>
113
<UL>
114
Specifies whether the user is allowed to type into the entry subwidget of
115
the ComboBox.
116
</UL>
117
<P>
118
<pre><code><code><code>
119
Name:           <B>fancy</B></I>
120
Class:          <B>Fancy</B></I>
121
Switch:         <B>-fancy</B></I>
122
</code></code></code></pre>
123
<UL>
124
A Boolean value specifying whether the cross and tick button
125
subwidgets should be shown.
126
</UL>
127
<P>
128
<pre><code><code><code>
129
Name:           <B>grab</B></I>
130
Class:          <B>Grab</B></I>
131
Switch:         <B>-grab</B></I>
132
</code></code></code></pre>
133
<UL>
134
Specifies the pointer grabbing policy when the listbox is popped up.
135
Only values "global", "local" or "none" are allowed. By default global
136
grab is used. However, when you are developing your application, you
137
may want to use only local grabbing so that in the event of errors,
138
</UL>
139
<P>
140
<pre><code><code><code>
141
Name:           <B>historyLimit</B></I>
142
Class:          <B>historyLimit</B></I>
143
Switch:         <B>-historylimit</B></I>
144
Alias:          <B>-histlimit</B></I>
145
</code></code></code></pre>
146
<UL>
147
Specifies how many previous user inputs can be stored in the history
148
list.
149
</UL>
150
<P>
151
<pre><code><code><code>
152
Name:           <B>history</B></I>
153
Class:          <B>History</B></I>
154
Switch:         <B>-history</B></I>
155
</code></code></code></pre>
156
<UL>
157
A Boolean value specifying whether previous user inputs should be
158
stored in the history list.
159
</UL>
160
<P>
161
<pre><code><code><code>
162
Name:           <B>label</B></I>
163
Class:          <B>Label</B></I>
164
Switch:         <B>-label</B></I>
165
</code></code></code></pre>
166
<UL>
167
Specifies the string to display as the label of this ComboBox widget.
168
</UL>
169
<P>
170
<pre><code><code><code>
171
Name:           <B>labelSide</B></I>
172
Class:          <B>LabelSide</B></I>
173
Switch:         <B>-labelside</B></I>
174
</code></code></code></pre>
175
<UL>
176
Specifies where the label should be displayed relative to the entry
177
subwidget. Valid options are: <B>top</B></I>, <B>left</B></I>, <B>right</B></I>,
178
<B>bottom</B></I>, <B>none</B></I> or <B>acrosstop</B></I>.
179
</UL>
180
<P>
181
<pre><code><code><code>
182
Name:           <B>listCmd</B></I>
183
Class:          <B>listCmd</B></I>
184
Switch:         <B>-listcmd</B></I>
185
</code></code></code></pre>
186
<UL>
187
Specifies a TCL command to be called every time when the listbox pops
188
up. This option allows you to fill up the listbox on-demand. This
189
option is ignored when the listbox is not in the <B>dropdown</B></I> style.
190
</UL>
191
<P>
192
<pre><code><code><code>
193
Name:           <B>listWidth</B></I>
194
Class:          <B>listWidth</B></I>
195
Switch:         <B>-listwidth</B></I>
196
</code></code></code></pre>
197
<UL>
198
If set, this option controls the width of the listbox subwidget when
199
it is popped up. The option is ignored when the listbox is not in the
200
<B>dropdown</B></I> style.
201
</UL>
202
<P>
203
<pre><code><code><code>
204
Name:           <B>prunehistory</B></I>
205
Class:          <B>PruneHistory</B></I>
206
Switch:         <B>-prunehistory</B></I>
207
</code></code></code></pre>
208
<UL>
209
Specifies whether duplicated previous user inputs should be pruned
210
from the the history list. Only Boolean values are allowed.
211
</UL>
212
<P>
213
<pre><code><code><code>
214
Name:           <B>selection</B></I>
215
Class:          <B>Selection</B></I>
216
Switch:         <B>-selection</B></I>
217
</code></code></code></pre>
218
<UL>
219
Contains the selection in the ComboBox (the string displayed in the
220
entry subwidget). Depending on the <B>-selectmode</B></I>, the selection
221
of a ComboBox may be different than its <B>-value</B></I>.
222
</UL>
223
<P>
224
<pre><code><code><code>
225
Name:           <B>selection</B></I>
226
Class:          <B>Selection</B></I>
227
Switch:         <B>-selection</B></I>
228
</code></code></code></pre>
229
<UL>
230
This option stores the temporary selection. When the user types in a
231
text string inside the entry widget, that string is considered as a
232
temporary input and is stored inside the <B>-selection</B></I> option. The
233
<B>-value</B></I> option is updated only when the user presses the return
234
key.
235
</UL>
236
<P>
237
<pre><code><code><code>
238
Name:           <B>selectMode</B></I>
239
Class:          <B>SelectMode</B></I>
240
Switch:         <B>-selectmode</B></I>
241
</code></code></code></pre>
242
<UL>
243
Specifies the how the combobox responds to the mouse button events in
244
the listbox subwidget; can eithet be <B>"browse"</B></I> or
245
<B>"immediate"</B></I>. The default <B>-selectmode</B></I> is "browse". See the
246
<B>BINDINGS</B></I> section below.
247
</UL>
248
<P>
249
<pre><code><code><code>
250
Name:           <B>state</B></I>
251
Class:          <B>State</B></I>
252
Switch:         <B>-state</B></I>
253
</code></code></code></pre>
254
<UL>
255
Specifies the whether the ComboBox is normal or disabled.
256
Only the values "normal" and "disabled" are recognized.
257
</UL>
258
<P>
259
<pre><code><code><code>
260
Name:           <B>tickBitmap</B></I>
261
Class:          <B>tickBitmap</B></I>
262
Switch:         <B>-tickbitmap</B></I>
263
</code></code></code></pre>
264
<UL>
265
Specifies the bitmap to be used in the "tick" button to the left of
266
the entry widget. The default is a bitmap in the file
267
$tix_library/bitmaps/tick
268
</UL>
269
<P>
270
<pre><code><code><code>
271
Name:           <B>validateCmd</B></I>
272
Class:          <B>ValidateCmd</B></I>
273
Switch:         <B>-validatecmd</B></I>
274
</code></code></code></pre>
275
<UL>
276
Specifies a TCL command to be called when the <B>-value</B></I> of the
277
ComboBox is about to change. This command is called with one parameter
278
-- the new <B>-value</B></I> entered by the user. This command is to
279
validate this new value by returning a value it deems valid.
280
</UL>
281
<P>
282
<pre><code><code><code>
283
Name:           <B>value</B></I>
284
Class:          <B>Value</B></I>
285
Switch:         <B>-value</B></I>
286
</code></code></code></pre>
287
<UL>
288
Specifies the string to be displayed in the entry subwidget of the
289
ComboBox. When queried, the returned value is the last value
290
selected by the user. When the <B>-value</B></I> option is changed as a
291
result of the <B>config -value</B></I> widget command, the TCL command
292
specified by the <B>-command</B></I> option is called.
293
</UL>
294
<P>
295
<pre><code><code><code>
296
Name:           <B>variable</B></I>
297
Class:          <B>Variable</B></I>
298
Switch:         <B>-variable</B></I>
299
</code></code></code></pre>
300
<UL>
301
Specifies the global variable in which the value of the
302
ComboBox should be stored. The value of the ComboBox
303
will be automatically updated when this variable is changed.
304
</UL>
305
</pre><H3>SUBWIDGETS</H3>
306
<P>
307
<pre><code><code><code>
308
Name:           <B>arrow</B></I>
309
Class:          <B>Button</B></I>
310
</code></code></code></pre>
311
<UL>
312
The down arrow button.
313
</UL>
314
<P>
315
<pre><code><code><code>
316
Name:           <B>cross</B></I>
317
Class:          <B>Button</B></I>
318
</code></code></code></pre>
319
<UL>
320
The cross button. Available only when <B>-fancy</B></I> is set.
321
</UL>
322
<P>
323
<pre><code><code><code>
324
Name:           <B>entry</B></I>
325
Class:          <B>Entry</B></I>
326
</code></code></code></pre>
327
<UL>
328
The entry that shows the value of this <B>tixControl</B></I>.
329
</UL>
330
<P>
331
<pre><code><code><code>
332
Name:           <B>label</B></I>
333
Class:          <B>Label</B></I>
334
</code></code></code></pre>
335
<UL>
336
The label subwidget.
337
</UL>
338
<P>
339
<pre><code><code><code>
340
Name:           <B>listbox</B></I>
341
Class:          <B>Listbox</B></I>
342
</code></code></code></pre>
343
<UL>
344
The listbox that holds all the list entries.
345
</UL>
346
<P>
347
<pre><code><code><code>
348
Name:           <B>slistbox</B></I>
349
Class:          <B>TixScrolledListBox</B></I>
350
</code></code></code></pre>
351
<UL>
352
The scrolled-listbox that provides the scrollbars.
353
</UL>
354
<P>
355
<pre><code><code><code>
356
Name:           <B>tick</B></I>
357
Class:          <B>Button</B></I>
358
</code></code></code></pre>
359
<UL>
360
The tick button. Available only when <B>-fancy</B></I> is set.
361
</UL>
362
</pre><HR>
363
</pre><H3>DESCRIPTION</H3>
364
<P>
365
The <B>tixComboBox</B></I> command creates a new window (given by the
366
<I>pathName</I></B> argument) and makes it into a <B>tixComboBox</B></I> widget.
367
Additional options, described above, may be specified on the command
368
line or in the option database to configure aspects of the
369
ComboBox such as its cursor and relief.
370
 
371
The Tix ComboBox widget is similar to the combo box control in
372
MS Windows. The user can select a choice by either typing in the entry
373
subwdget or selecting from the listbox subwidget.
374
</pre><H3>WIDGET COMMANDS</H3>
375
<P>
376
The <B>tixComboBox</B></I> command creates a new Tcl command whose name is the
377
may be used to invoke various operations on the widget. It has the
378
following general form:
379
<pre>
380
<I>pathName option </I></B>?<I>arg arg ...</I></B>?
381
<P>
382
</pre>
383
<I>PathName</I></B> is the name of the command, which is the same as the
384
determine the exact behavior of the command.  The following commands
385
are possible for ComboBox widgets:
386
<DL>
387
<DT> <I>pathName <B>addhistory<I> string </I></B>
388
</I></B>
389
<DD> Add the string to the beinning of the listbox.
390
</DL>
391
<DL>
392
<DT> <I>pathName <B>appendhistory<I> string </I></B>
393
</I></B>
394
<DD> Append the string to the end of the listbox.
395
</DL>
396
<DL>
397
<DT> <I>pathName <B>cget</B></I> <I>option</I></B>
398
</I></B>
399
<DD> Returns the current value of the configuration option given by
400
<I>option</I></B>.  <I>Option</I></B> may have any of the values accepted by the
401
<B>tixComboBox</B></I> command.
402
</DL>
403
<DL>
404
<DT> <I>pathName <B>configure</B></I> ?<I>option</I></B>? <I>?value option value ...</I></B>?
405
</I></B>
406
<DD> Query or modify the configuration options of the widget.  If no
407
<I>option</I></B> is specified, returns a list describing all of the
408
available options for <I>pathName</I></B> (see <B>Tk_ConfigureInfo</B></I> for
409
information on the format of this list).  If <I>option</I></B> is specified
410
with no <I>value</I></B>, then the command returns a list describing the
411
one named option (this list will be identical to the corresponding
412
sublist of the value returned if no <I>option</I></B> is specified).  If
413
one or more <I>option-value</I></B> pairs are specified, then the command
414
modifies the given widget option(s) to have the given value(s); in
415
this case the command returns an empty string.  <I>Option</I></B> may have
416
any of the values accepted by the <B>tixComboBox</B></I> command.
417
</DL>
418
<DL>
419
<DT> <I>pathName <B>flash <I>index string</I></B>
420
</I></B>
421
<DD> Flashes the ComboBox. <B>flash</B></I> is usually called by a
422
<I>-command</I></B> procedure to acknowledge to the user that he has
423
selected a value for the ComboBox.
424
</DL>
425
<DL>
426
<DT> <I>pathName <B>insert <I>index string</I></B>
427
</I></B>
428
<DD> Insert the <I> string</I></B> into the listbox at the specified index.
429
<I>index</I></B> must be a valid listbox index.
430
</DL>
431
<DL>
432
<DT> <I>pathName <B>pick <I>index</I></B>
433
</I></B>
434
<DD> Set the (<I>index</I></B>)th item in the listbox to be the current value of
435
the ComboBox. As a result, the <I>value</I></B> of the ComboBox is changed
436
and the TCL command sepcified by the <I>-command</I></B> option will be
437
called.
438
</DL>
439
<DL>
440
<DT> <I>pathName <B>subwidget <I> name ?args?</I></B>
441
</I></B>
442
<DD> When no options are given, returns the pathname of the subwidget of
443
the specified name.
444
 
445
When options are given, the widget command of the specified subwidget will
446
be called with these options.
447
</DL>
448
<P>
449
</pre><H3>BINDINGS</H3>
450
<P>
451
<UL>
452
[1] <BR>
453
If the <B>-selectmode</B></I> is "immediate", when the user enters a
454
keystroke, clicks on an item or drags the mouse pointer in the
455
listbox, the <B>-value</B></I> of the ComboBox will be immediately set to
456
this item and the <B>-command</B></I> procedure will be called.
457
</UL>
458
<UL>
459
[2] <BR>
460
If the <B>-selectmode</B></I> is "browse", when the user enters a
461
keystroke, clicks on an item or drags the mouse pointer in the
462
listbox, the <B>-selection</B></I> of the ComboBox will be immediately set
463
to the new content of the entry subwidget; also the <B>-browsecmd</B></I>
464
procedure will be called. The <B>-value</B></I> option will be changed
465
only when the user invokes the ComboBox (see [3] below). If the user
466
presses the &lt;Escape&gt; key at any time, any new <B>-selection</B></I> will
467
be ignored and the text inside the entry subwidget will be restored to
468
the current <B>-value</B></I> of the ComboBox.
469
</UL>
470
<UL>
471
[3] <BR>
472
If the <B>-dropdown</B></I> option is true, the user can invoke the
473
ComboBox by releasing the left mouse button over the desired item in
474
the listbox. If the <B>-dropdown</B></I> option is false, the user can
475
invoke the ComboBox by double-clicking over the desired item in the
476
listbox. In both cases, the user can also invoke the listbox by
477
pressing the &lt;Return&gt; or &lt;Tab&gt; key inside the entry subwidget, or
478
switching the input focus to another widget inside the same toplevel
479
widget
480
</UL>
481
<P>
482
</pre><H3>BUGS</H3>
483
<P>
484
Starting from Tix vetsion 4.0, the default <B>-value</B></I> of the
485
ComboBox is the empty string. If you want the ComboBox to show a
486
string by default, you must configure its <B>-value</B></I> option
487
explicitly.
488
<P>
489
</pre><H3>KEYWORDS</H3>
490
Tix(n), ComboBox(n), listbox(n)
491
<hr><i>Last modified Sun Jan 19 22:34:20 EST 1997 </i> ---
492
<i>Serial 853731296</i>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.