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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [itcl/] [iwidgets3.0.0/] [demos/] [html/] [combobox.n.html] - Blame information for rev 1770

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

Line No. Rev Author Line
1 578 markom
<HTML>
2
<HEAD>
3
<TITLE>iwidgets2.2.0 User Commands - combobox</TITLE>
4
</HEAD>
5
<BODY BGCOLOR="#FFFFFF">
6
<H1>iwidgets2.2.0 User Commands - combobox</H1>
7
<HR>
8
<PRE>
9
 
10
</PRE>
11
<H2><HR ALIGN=LEFT WIDTH=70% SIZE=3></H2><PRE>
12
 
13
 
14
</PRE>
15
<H2>NAME</H2><PRE>
16
     combobox - Create and manipulate combination box widgets
17
 
18
 
19
</PRE>
20
<H2>SYNOPSIS</H2><PRE>
21
     <STRONG>combobox</STRONG> <EM>pathName</EM> ?<EM>options</EM>?
22
 
23
 
24
</PRE>
25
<H2>INHERITANCE</H2><PRE>
26
     itk::Widget &lt;- LabeledWidget &lt;- Entryfield &lt;- Combobox
27
 
28
 
29
</PRE>
30
<H2>STANDARD OPTIONS</H2><PRE>
31
     <STRONG>background</STRONG>      <STRONG>borderWidth</STRONG>    <STRONG>cursor</STRONG>          <STRONG>exportSelection</STRONG>
32
     <STRONG>foreground</STRONG>      <STRONG>highlightColor</STRONG> <STRONG>highlightThicknessinsertBackground</STRONG>
33
     <STRONG>insertBorderWidth</STRONG>              <STRONG>insertOffTime</STRONG>   <STRONG>insertOnTimeinsertWidth</STRONG>
34
     <STRONG>justify</STRONG>         <STRONG>relief</STRONG>         <STRONG>selectBackgroundselectBorderWidth</STRONG>
35
     <STRONG>selectForeground</STRONG>               <STRONG>textVariable</STRONG>    <STRONG>width</STRONG>
36
 
37
     See the "options" manual entry for details on  the  standard
38
     options.
39
 
40
 
41
</PRE>
42
<H2>ASSOCIATED OPTIONS</H2><PRE>
43
     <STRONG>hscrollmode</STRONG>     <STRONG>items</STRONG>          <STRONG>textBackground</STRONG>  <STRONG>textFont</STRONG>
44
     <STRONG>vscrollmode</STRONG>
45
 
46
     See the "scrolledlistbox" manual entry for  details  on  the
47
     above inherited options.
48
 
49
     <STRONG>show</STRONG>            <STRONG>state</STRONG>
50
 
51
     See the "entry" manual entry for details on the above inher-
52
     ited options.
53
 
54
 
55
</PRE>
56
<H2>INHERITED OPTIONS</H2><PRE>
57
     <STRONG>childSitePos</STRONG>    <STRONG>command</STRONG>        <STRONG>fixed</STRONG>           <STRONG>focusCommand</STRONG>
58
     <STRONG>invalid</STRONG>         <STRONG>textBackground</STRONG> <STRONG>textFont</STRONG>        <STRONG>validate</STRONG>
59
 
60
     See the "entryfield" class manual entry for details  on  the
61
     inherited options.
62
 
63
     <STRONG>labelBitmap</STRONG>     <STRONG>labelFont</STRONG>      <STRONG>labelImage</STRONG>      <STRONG>labelMargin</STRONG>
64
     <STRONG>labelPos</STRONG>        <STRONG>labelText</STRONG>      <STRONG>labelVariable</STRONG>
65
 
66
     See the "labeledwidget" class manual entry  for  details  on
67
     the inherited options.
68
 
69
 
70
</PRE>
71
<H2>WIDGET-SPECIFIC OPTIONS</H2><PRE>
72
     Name:           <STRONG>autoClear</STRONG>
73
     Class:          <STRONG>AutoClear</STRONG>
74
     Command-Line Switch:           <STRONG>-autoclear</STRONG>
75
 
76
          Boolean value that specifies wheather or not  to  clear
77
          the entry field as items are added to the list given in
78
          any of the forms  acceptable  to  <STRONG>Tcl_GetBoolean</STRONG>.   The
79
          default is true.
80
 
81
     Name:           <STRONG>arrowRelief</STRONG>
82
     Class:          <STRONG>Relief</STRONG>
83
     Command-Line Switch:           <STRONG>-arrowrelief</STRONG>
84
 
85
          Specifies the  relief  style  to  use  for  a  dropdown
86
          Combobox's  arrow  button  in  a normal (not depressed)
87
          state. Acceptable  values  are  <STRONG>raised</STRONG>,  <STRONG>sunken</STRONG>,  <STRONG>flat</STRONG>,
88
          <STRONG>ridge</STRONG>, and <STRONG>groove</STRONG>. Sunken is discouraged as this is the
89
          relief used to indicate a depressed state. This  option
90
          has  no  effect  on  simple  Comboboxes. The default is
91
          raised.
92
 
93
     Name:           <STRONG>dropdown</STRONG>
94
     Class:          <STRONG>Dropdown</STRONG>
95
     Command-Line Switch:           <STRONG>-dropdown</STRONG>
96
 
97
          Boolean describing the Combobox layout style  given  in
98
          any of the forms acceptable to <STRONG>Tcl_GetBoolean</STRONG>. If true,
99
          the Combobox will be  a  dropdown  style  widget  which
100
          displays  an entry field and an arrow button which when
101
          activated will pop up a scrollable list  of  items.  If
102
          false,  a  simple Combobox style will be used which has
103
          an entry field and a scrollable list beneath  it  which
104
          is  always visible. Both styles allow an optional label
105
          for the entry field area. The default is true.
106
 
107
     Name:           <STRONG>editable</STRONG>
108
     Class:          <STRONG>Editable</STRONG>
109
     Command-Line Switch:           <STRONG>-editable</STRONG>
110
 
111
          Boolean describing whether or not the text  entry  area
112
          is editable by the user. If true the user can add items
113
          to the combobox by entering text into  the  entry  area
114
          and  then  pressing Return. If false, the list of items
115
          is non-editable and can only be changed by calling  the
116
          insert  or  delete  methods.  Given in any of the forms
117
          acceptable to <STRONG>Tcl_GetBoolean</STRONG>. The default is true.
118
 
119
     Name:           <STRONG>flipArrow</STRONG>
120
     Class:          <STRONG>FlipArrow</STRONG>
121
     Command-Line Switch:           <STRONG>-fliparrow</STRONG>
122
 
123
          Boolean describing whether or not the arrow  button  of
124
          dropdowns  should  be reversed (point up) when the list
125
          is popped up. Given in any of the forms  acceptable  to
126
          <STRONG>Tcl_GetBoolean</STRONG>. The default is false.
127
 
128
 
129
     Name:           <STRONG>listHeight</STRONG>
130
     Class:          <STRONG>Height</STRONG>
131
     Command-Line Switch:           <STRONG>-listheight</STRONG>
132
 
133
          Height of the listbox specified in  any  of  the  forms
134
          acceptable to <STRONG>Tk_GetPixels</STRONG>.  The default is 100 pixels.
135
 
136
     Name:           <STRONG>margin</STRONG>
137
     Class:          <STRONG>Margin</STRONG>
138
     Command-Line Switch:           <STRONG>-margin</STRONG>
139
 
140
          Specifies the width in pixels between  the  entry  com-
141
          ponent  and  the  arrow  button for a dropdown Combobox
142
          given in any of the forms acceptable  to  <STRONG>Tk_GetPixels</STRONG>.
143
          This  option  has  no  effect on a simple Combobox. The
144
          default is 0.
145
 
146
     Name:           <STRONG>popupCursor</STRONG>
147
     Class:          <STRONG>Cursor</STRONG>
148
     Command-Line Switch:           <STRONG>-popupcursor</STRONG>
149
 
150
          Specifies the cursor to  be  used  for  dropdown  style
151
          listboxes.  The value may have any of the forms accept-
152
          able to <STRONG>Tk_GetCursor</STRONG>. The default is arrow.
153
 
154
     Name:           <STRONG>selectionCommand</STRONG>
155
     Class:          <STRONG>SelectionCommand</STRONG>
156
     Command-Line Switch:           <STRONG>-selectioncommand</STRONG>
157
 
158
          Specifies a Tcl command procedure which is called  when
159
          an  item in the listbox area is selected. The item will
160
          be selected in the list, the listbox will be removed if
161
          it is a dropdown Combobox, and the selected item's text
162
          will be  inserted  into  the  entry  field  before  the
163
          -selectioncommand proc is called. The default is {}.
164
 
165
     Name:           <STRONG>unique</STRONG>
166
     Class:          <STRONG>Unique</STRONG>
167
     Command-Line Switch:           <STRONG>-unique</STRONG>
168
 
169
          Boolean describing whether or not duplicate  items  are
170
          allowed  in the combobox list. If true, then duplicates
171
          are not allowed to be inserted. If false,  a  duplicate
172
          entry causes selection of the item. Given in any of the
173
          forms acceptable  to  <STRONG>Tcl_GetBoolean</STRONG>.  The  default  is
174
          true.
175
 
176
</PRE>
177
<H2><HR ALIGN=LEFT WIDTH=70% SIZE=3></H2><PRE>
178
 
179
 
180
 
181
</PRE>
182
<H2>DESCRIPTION</H2><PRE>
183
     The <STRONG>combobox</STRONG> command creates an enhanced entry field  widget
184
     with  an  optional  associated  label and a scrollable list.
185
     When an item is selected in the list area of a Combobox it's
186
     value  is then displayed in the entry field text area. Func-
187
     tionally  similar  to  an  Optionmenu,  the  Combobox   adds
188
     (optional)  list  scrolling  and (optional) item editing and
189
     inserting capabilities.
190
 
191
     There are two basic styles of Comboboxes (determined by  the
192
     -dropdown  option):  dropdown and simple. The dropdown style
193
     adds an arrow button to the right of the entry  field  which
194
     when  activated  will pop up (and down) the scrolled listbox
195
     beneath the entry field. The simple (non-dropdown)  Combobox
196
     permanently displays the listbox beneath the entry field and
197
     has no arrow button. Either style allows an  optional  entry
198
     field label.
199
 
200
 
201
</PRE>
202
<H2>METHODS</H2><PRE>
203
     The <STRONG>combobox</STRONG> command creates a new Tcl command whose name is
204
     <EM>pathName</EM>.  This command may be used to invoke various opera-
205
     tions on the widget. It has the following general form:
206
 
207
          <EM>pathName</EM> <EM>option</EM> ?<EM>arg</EM> <EM>arg</EM> ...?
208
 
209
     <EM>Option</EM> and the <EM>arg</EM>s determine the exact behavior of the com-
210
     mand. The following commands are possible for Combobox widg-
211
     ets:
212
 
213
 
214
</PRE>
215
<H2>ASSOCIATED METHODS</H2><PRE>
216
     <STRONG>icursor</STRONG>         <STRONG>scan</STRONG>
217
 
218
     See the "entry" manual entries  for  details  on  the  above
219
     associated methods.
220
 
221
     <STRONG>curselection</STRONG>    <STRONG>index</STRONG>          <STRONG>see</STRONG>             <STRONG>size</STRONG>
222
     <STRONG>xview</STRONG>           <STRONG>yview</STRONG>
223
 
224
     See the "listbox" manual entries for details  on  the  above
225
     associated methods.
226
 
227
     <STRONG>getcurselection</STRONG> <STRONG>justify</STRONG>        <STRONG>sort</STRONG>
228
 
229
     See the "scrolledlistbox" manual entries for details on  the
230
     above associated methods.
231
 
232
 
233
</PRE>
234
<H2>WIDGET-SPECIFIC METHODS</H2><PRE>
235
     <EM>pathName</EM> <STRONG>cget</STRONG> <EM>option</EM>
236
          Returns the current value of the  configuration  option
237
          given  by  <EM>option</EM>.   <EM>Option</EM>  may have any of the values
238
          accepted by the <STRONG>combobox</STRONG> command.
239
 
240
     <EM>pathName</EM> <STRONG>clear</STRONG> ?<STRONG>component</STRONG>?
241
          Clears the contents from one or both components.  Valid
242
          component values are <STRONG>list</STRONG>, or <STRONG>entry</STRONG>.  With no component
243
          specified, both are cleared.
244
 
245
     <EM>pathName</EM> <STRONG>configure</STRONG> ?<EM>option</EM>? ?<EM>value</EM> <EM>option</EM> <EM>value</EM> ...?
246
          Query  or  modify  the  configuration  options  of  the
247
          widget.   If  no  <EM>option</EM>  is  specified, returns a list
248
          describing all of the available  options  for  <EM>pathName</EM>
249
          (see  <STRONG>Tk_ConfigureInfo</STRONG> for information on the format of
250
          this list).  If <EM>option</EM> is specified with no <EM>value</EM>, then
251
          the  command  returns  a  list describing the one named
252
          option (this list will be identical to the  correspond-
253
          ing  sublist  of  the  value  returned  if no <EM>option</EM> is
254
          specified).  If one or more  <EM>option</EM> - <EM>value</EM>  pairs  are
255
          specified,  then  the command modifies the given widget
256
          option(s) to have the given value(s);  in this case the
257
          command  returns  an empty string.  <EM>Option</EM> may have any
258
          of the values accepted by the <STRONG>combobox</STRONG> command.
259
 
260
     <EM>pathName</EM> <STRONG>delete</STRONG> <EM>component</EM> <EM>first</EM> ?<EM>last</EM>?
261
          Delete one or more elements  from  a  given  component,
262
          <STRONG>list</STRONG>  or  <STRONG>entry</STRONG>.   If  a  list  item  to  be removed is
263
          currently selected (displayed in the entry field area),
264
          the entry field will be cleared.
265
 
266
     <EM>pathName</EM> <STRONG>get</STRONG> <STRONG>?</STRONG><EM>index</EM>?
267
          With no arguments, returns the  contents  currently  in
268
          the  entry  field area. With a single argument, returns
269
          the contents of  the  listbox  item  at  the  indicated
270
          index.
271
 
272
     <EM>pathName</EM> <STRONG>insert</STRONG> <EM>component</EM> <EM>index</EM> <EM>element</EM> ?<EM>element</EM> <EM>element</EM> ...?
273
          Insert  one  or  more  new elements into the given com-
274
          ponent, <STRONG>list</STRONG> or <STRONG>entry</STRONG>, just before the element given by
275
          <EM>index</EM>.
276
 
277
     <EM>pathName</EM> <STRONG>selection</STRONG> <EM>option</EM> <EM>first</EM> ?<EM>last</EM>?
278
          Adjust the selection within the listbox  component  and
279
          updates  the  contents  of the entry field component to
280
          the value of  the  selected  item.  See  the  "listbox"
281
          manual entry for more details on parameter options.
282
 
283
 
284
</PRE>
285
<H2>COMPONENTS</H2><PRE>
286
     Name:           <STRONG>entry</STRONG>
287
     Class:          <STRONG>Entryfield</STRONG>
288
 
289
          Text  entry  area  where  the  current   selection   is
290
          displayed.  If  the  Combobox is editable, the user can
291
          edit the contents of this item.
292
 
293
     Name:           <STRONG>list</STRONG>
294
     Class:          <STRONG>Scrolledlistbox</STRONG>
295
 
296
          Scrollable list which stores all the  items  which  the
297
          user  can  select  from.  For dropdown Comboboxes, this
298
          component is hidden until the user pops it up by press-
299
          ing  on the arrow button to the right of the entry com-
300
          ponent. For simple Comboboxes this component is  always
301
          visible just beneath the entry component.
302
 
303
 
304
</PRE>
305
<H2>DEFAULT BINDINGS</H2><PRE>
306
     The Combobox generally has the same bindings as it's primary
307
     component  items  - the Scrolledlistbox and Entryfield. How-
308
     ever it also adds these:
309
 
310
     [1] Button-1 mouse press on the arrow key of a dropdown Com-
311
     bobox  causes  the  list to be popped up. If the combobox is
312
     non-editable, a Button-1 press on the entry field area  will
313
     also pop up the list.
314
 
315
     [2] Button-1 mouse press anywhere on the display  removes  a
316
     dropdown  listbox  which  has  been  popped  up,  unless the
317
     keypress is  upon  one  of  the  Combobox  scrollbars  which
318
     scrolls  the list. If it is pressed upon an item in the list
319
     area, that item will be selected before the list is removed.
320
 
321
     [3] Button-3 mouse press on the arrow key of a dropdown Com-
322
     bobox  causes  the  next item to be selected. Shift-Button-3
323
     causes the previous item to be selected.
324
 
325
     [4] Escape keypress removes a dropdown list which  has  been
326
     popped up.
327
 
328
     [5] The &lt;space&gt; and &lt;Return&gt; keystrokes select  the  current
329
     item.  They also remove the popped up list for dropdown com-
330
     boboxes.
331
 
332
     [6] Up and Down arrow keypresses from the  entry  field  and
333
     arrow  button component cause the previous and next items in
334
     the listbox to be selected respectively. Ctl-P and Ctl-N are
335
     similarly mapped for emacs emulation.
336
 
337
     [7] Entry field and  arrow  button  component  Shift-Up  and
338
     Shift-Down arrow keys pop up and down the listbox of a drop-
339
     down Combobox. The arrow button component also maps &lt;Return&gt;
340
     and &lt;space&gt; similarly.
341
 
342
 
343
 
344
</PRE>
345
<H2>EXAMPLE</H2><PRE>
346
           proc selectCmd {} {
347
              puts stdout "[.cb2 getcurselection]"
348
           }
349
 
350
           #
351
           # Non-editable Dropdown Combobox
352
           #
353
           combobox .cb1 -labeltext Month: \
354
               -selectioncommand {puts "selected: [.cb1 getcurselection]"} \
355
               -editable false -listheight 185 -popupcursor hand1 \
356
               -items {Jan Feb Mar Apr May June Jul Aug Sept Oct Nov Dec}
357
 
358
           #
359
           # Editable Dropdown Combobox
360
           #
361
           combobox .cb2 -labeltext "Operating System:" \
362
              -items {Linux HP-UX SunOS Solaris Irix} -selectioncommand selectCmd
363
 
364
           #
365
           # Simple Combobox
366
           #
367
           combobox .cb3 -labeltext Fonts: -labelpos nw \
368
             -dropdown false -listheight 220 -items [exec xlsfonts]
369
 
370
           pack .cb1 -padx 10 -pady 10 -fill x
371
           pack .cb2 -padx 10 -pady 10 -fill x
372
           pack .cb3 -padx 10 -pady 10 -fill x
373
 
374
 
375
 
376
 
377
</PRE>
378
<H2>AUTHOR</H2><PRE>
379
     John S. Sigler
380
 
381
 
382
</PRE>
383
<H2>KEYWORDS</H2><PRE>
384
     combobox, entryfield, scrolledlistbox,  itk::Widget,  entry,
385
     listbox, widget, iwidgets
386
 
387
 
388
 
389
 
390
 
391
 
392
 
393
 
394
 
395
 
396
 
397
 
398
 
399
 
400
 
401
 
402
 
403
 
404
 
405
 
406
 
407
 
408
 
409
</PRE>
410
</BODY>
411
</HTML>

powered by: WebSVN 2.1.0

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