File: classWt_1_1WComboBox.html

package info (click to toggle)
witty 3.1.2-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 45,512 kB
  • ctags: 35,832
  • sloc: cpp: 69,469; ansic: 66,945; xml: 4,383; sh: 594; perl: 108; makefile: 106
file content (497 lines) | stat: -rw-r--r-- 32,168 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Wt: Wt::WComboBox Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespaceWt.html">Wt</a>::<a class="el" href="classWt_1_1WComboBox.html">WComboBox</a>
  </div>
</div>
<div class="contents">
<h1>Wt::WComboBox Class Reference<br>
<small>
[<a class="el" href="group__modelview.html">Model/view system</a>]</small>
</h1><!-- doxytag: class="Wt::WComboBox" --><!-- doxytag: inherits="Wt::WFormWidget" -->A widget that provides a drop-down combo-box control.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;Wt/WComboBox&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for Wt::WComboBox:</div>
<div class="dynsection">
<p><center><img src="classWt_1_1WComboBox__inherit__graph.png" border="0" usemap="#Wt_1_1WComboBox__inherit__map" alt="Inheritance graph"></center>
<map name="Wt_1_1WComboBox__inherit__map">
<area shape="rect" href="classWt_1_1WSelectionBox.html" title="A selection box allows selection from a list of options." alt="" coords="9,453,143,480"><area shape="rect" href="classWt_1_1WFormWidget.html" title="An abstract widget that corresponds to an HTML form element." alt="" coords="12,304,140,331"><area shape="rect" href="classWt_1_1WInteractWidget.html" title="An abstract widget that can receive user&#45;interface interaction." alt="" coords="5,229,147,256"><area shape="rect" href="classWt_1_1WWebWidget.html" title="A base class for widgets with an HTML counterpart." alt="" coords="15,155,137,181"><area shape="rect" href="classWt_1_1WWidget.html" title="The abstract base class for a user&#45;interface component." alt="" coords="28,80,124,107"><area shape="rect" href="classWt_1_1WObject.html" title="A base class for objects that participate in the signal/slot system." alt="" coords="28,5,124,32"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classWt_1_1WComboBox-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0403b5ef9b90f4868a3177245f0bbb62"></a><!-- doxytag: member="Wt::WComboBox::WComboBox" ref="0403b5ef9b90f4868a3177245f0bbb62" args="(WContainerWidget *parent=0)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#0403b5ef9b90f4868a3177245f0bbb62">WComboBox</a> (<a class="el" href="classWt_1_1WContainerWidget.html">WContainerWidget</a> *parent=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates an empty combo-box with optional <em>parent</em>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#9b2308a7d962ceb17c1ee32627b106d4">addItem</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;text)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Adds an option item.  <a href="#9b2308a7d962ceb17c1ee32627b106d4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="58fff2a9bd76213f107cbc776e15112e"></a><!-- doxytag: member="Wt::WComboBox::count" ref="58fff2a9bd76213f107cbc776e15112e" args="() const " -->
int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#58fff2a9bd76213f107cbc776e15112e">count</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the number of items. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#94b6a87121adab0abbf23562d35a716e">currentIndex</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the currently selected item.  <a href="#94b6a87121adab0abbf23562d35a716e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#2092c15c7c0c2f77342d0abdc393ca6b">insertItem</a> (int index, const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;text)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Inserts an item at the specified position.  <a href="#2092c15c7c0c2f77342d0abdc393ca6b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#95db6ec7468a1eabbf95f7eba3012a54">removeItem</a> (int index)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Removes the item at the specified position.  <a href="#95db6ec7468a1eabbf95f7eba3012a54"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#903e2d98c6860fe09198bdb43f0566bd">setCurrentIndex</a> (int index)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Changes the current selection.  <a href="#903e2d98c6860fe09198bdb43f0566bd"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#8eafbaa6e87ca46a411b904b78b12db6">setItemText</a> (int index, const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;text)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Changes the text for a specified option.  <a href="#8eafbaa6e87ca46a411b904b78b12db6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classWt_1_1WString.html">WString</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#ec0856e1bacf24fded9621054a0c357c">currentText</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the text of the currently selected item.  <a href="#ec0856e1bacf24fded9621054a0c357c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classWt_1_1WString.html">WString</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#f787aa7aa37e2ce2eddb499c15db52a4">itemText</a> (int index) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the text of a particular item.  <a href="#f787aa7aa37e2ce2eddb499c15db52a4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#3d10438b053fe43dcd05e66b7ca78826">setModel</a> (<a class="el" href="classWt_1_1WAbstractItemModel.html">WAbstractItemModel</a> *model)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the model to be used for the items.  <a href="#3d10438b053fe43dcd05e66b7ca78826"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#5d33b665d2fa12b349fa2783ba4d2033">setModelColumn</a> (int index)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the column in the model to be used for the items.  <a href="#5d33b665d2fa12b349fa2783ba4d2033"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1WAbstractItemModel.html">WAbstractItemModel</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#20b54b2271b0219c2375775538d454a3">model</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the data model.  <a href="#20b54b2271b0219c2375775538d454a3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="98d44c32191d2cc80be14da1bf6acb3a"></a><!-- doxytag: member="Wt::WComboBox::findText" ref="98d44c32191d2cc80be14da1bf6acb3a" args="(const WString &amp;text, WFlags&lt; MatchFlag &gt; flags=MatchExactly|MatchCaseSensitive)" -->
int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#98d44c32191d2cc80be14da1bf6acb3a">findText</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;text, WFlags&lt; <a class="el" href="group__modelview.html#gad8dd5072a40c11a34ee548bfb20b2ba">MatchFlag</a> &gt; flags=MatchExactly|MatchCaseSensitive)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the index of the first item that matches a text. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="36ca680db19aac3ac847a422bb821b6e"></a><!-- doxytag: member="Wt::WComboBox::validate" ref="36ca680db19aac3ac847a422bb821b6e" args="()" -->
<a class="el" href="classWt_1_1WValidator.html#638a1feefca259ea2f806a8add2d18a3">WValidator::State</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#36ca680db19aac3ac847a422bb821b6e">validate</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Validates the field. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#ea94ab9c31cd5030906d73a8134e6e00">refresh</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Refresh the widget.  <a href="#ea94ab9c31cd5030906d73a8134e6e00"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#0ed207e9616b51089d97030cc767409d">clear</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Clears all items.  <a href="#0ed207e9616b51089d97030cc767409d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1Signal.html">Signal</a>&lt; int &gt; &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#c39b46ccd8134a5397b4cbd87dc9f01f">activated</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Signal emitted when the selection changed.  <a href="#c39b46ccd8134a5397b4cbd87dc9f01f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1Signal.html">Signal</a>&lt; <a class="el" href="classWt_1_1WString.html">WString</a> &gt; &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#06401499734540c65db26fceb60bfdbf">sactivated</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Signal emitted when the selection changed.  <a href="#06401499734540c65db26fceb60bfdbf"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A widget that provides a drop-down combo-box control. 
<p>
A combo box provides the user with a set of options, from which one option may be selected.<p>
WComboBox is an MVC view class, using a simple string list model by default. The model may be populated using addItem(const <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>&amp;) or <a class="el" href="classWt_1_1WComboBox.html#2092c15c7c0c2f77342d0abdc393ca6b" title="Inserts an item at the specified position.">insertItem(int, const WString&amp;)</a> and the contents can be cleared through <a class="el" href="classWt_1_1WComboBox.html#0ed207e9616b51089d97030cc767409d" title="Clears all items.">clear()</a>. These methods manipulate the underlying <a class="el" href="classWt_1_1WComboBox.html#20b54b2271b0219c2375775538d454a3" title="Returns the data model.">model()</a>.<p>
To use the combo box with a custom model instead of the default <a class="el" href="classWt_1_1WStringListModel.html" title="An model that manages a list of strings.">WStringListModel</a>, use <a class="el" href="classWt_1_1WComboBox.html#3d10438b053fe43dcd05e66b7ca78826" title="Sets the model to be used for the items.">setModel()</a>.<p>
To react to selection events, connect to the <a class="el" href="classWt_1_1WFormWidget.html#5216ba1594b5dc525cc47cad593c7ba8" title="Signal emitted when the value was changed.">changed()</a>, <a class="el" href="classWt_1_1WComboBox.html#c39b46ccd8134a5397b4cbd87dc9f01f" title="Signal emitted when the selection changed.">activated()</a> or <a class="el" href="classWt_1_1WComboBox.html#06401499734540c65db26fceb60bfdbf" title="Signal emitted when the selection changed.">sactivated()</a> signals.<p>
At all times, the current selection index is available through <a class="el" href="classWt_1_1WComboBox.html#94b6a87121adab0abbf23562d35a716e" title="Returns the currently selected item.">currentIndex()</a> and the current selection text using <a class="el" href="classWt_1_1WComboBox.html#ec0856e1bacf24fded9621054a0c357c" title="Returns the text of the currently selected item.">currentText()</a>.<p>
Usage example: <div class="fragment"><pre class="fragment"> <a class="code" href="classWt_1_1WComboBox.html" title="A widget that provides a drop-down combo-box control.">Wt::WComboBox</a> *combo = <span class="keyword">new</span> <a class="code" href="classWt_1_1WComboBox.html" title="A widget that provides a drop-down combo-box control.">Wt::WComboBox</a>(<span class="keyword">this</span>);
 combo-&gt;<a class="code" href="classWt_1_1WComboBox.html#9b2308a7d962ceb17c1ee32627b106d4" title="Adds an option item.">addItem</a>(<span class="stringliteral">"Clint Eastwood"</span>);
 combo-&gt;<a class="code" href="classWt_1_1WComboBox.html#9b2308a7d962ceb17c1ee32627b106d4" title="Adds an option item.">addItem</a>(<span class="stringliteral">"Mick Jagger"</span>);
 combo-&gt;<a class="code" href="classWt_1_1WComboBox.html#9b2308a7d962ceb17c1ee32627b106d4" title="Adds an option item.">addItem</a>(<span class="stringliteral">"Johnny Depp"</span>);
 combo-&gt;<a class="code" href="classWt_1_1WComboBox.html#9b2308a7d962ceb17c1ee32627b106d4" title="Adds an option item.">addItem</a>(<span class="stringliteral">"Kate Winslet"</span>);

 combo-&gt;<a class="code" href="classWt_1_1WComboBox.html#903e2d98c6860fe09198bdb43f0566bd" title="Changes the current selection.">setCurrentIndex</a>(2); <span class="comment">// Johnny Depp</span>
 combo-&gt;<a class="code" href="classWt_1_1WComboBox.html#c39b46ccd8134a5397b4cbd87dc9f01f" title="Signal emitted when the selection changed.">activated</a>().connect(SLOT(<span class="keyword">this</span>, MyWidget::comboChanged));
</pre></div><p>
WComboBox is an <a class="el" href="classWt_1_1WWidget.html#c78e3af143883334c82031790c87416e">inline </a> widget.<p>
<h3>CSS</h3>
<p>
The widget corresponds to the HTML <code>&lt;select&gt;</code> tag and does not provide styling. It can be styled using inline or external CSS as appropriate. <hr><h2>Member Function Documentation</h2>
<a class="anchor" name="9b2308a7d962ceb17c1ee32627b106d4"></a><!-- doxytag: member="Wt::WComboBox::addItem" ref="9b2308a7d962ceb17c1ee32627b106d4" args="(const WString &amp;text)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WComboBox::addItem           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>text</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Adds an option item. 
<p>
Equivalent to <a class="el" href="classWt_1_1WComboBox.html#2092c15c7c0c2f77342d0abdc393ca6b">insertItem</a> (<a class="el" href="classWt_1_1WComboBox.html#58fff2a9bd76213f107cbc776e15112e" title="Returns the number of items.">count()</a>, <code>text</code>). 
</div>
</div><p>
<a class="anchor" name="94b6a87121adab0abbf23562d35a716e"></a><!-- doxytag: member="Wt::WComboBox::currentIndex" ref="94b6a87121adab0abbf23562d35a716e" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Wt::WComboBox::currentIndex           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the currently selected item. 
<p>
If no item is currently selected, the method returns -1.<p>
The default value is 0, unless the combo box is empty. 
</div>
</div><p>
<a class="anchor" name="2092c15c7c0c2f77342d0abdc393ca6b"></a><!-- doxytag: member="Wt::WComboBox::insertItem" ref="2092c15c7c0c2f77342d0abdc393ca6b" args="(int index, const WString &amp;text)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WComboBox::insertItem           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>text</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Inserts an item at the specified position. 
<p>
The item is inserted in the underlying model at position <code>index</code>. This requires that the <a class="el" href="classWt_1_1WComboBox.html#20b54b2271b0219c2375775538d454a3" title="Returns the data model.">model()</a> is editable.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#9b2308a7d962ceb17c1ee32627b106d4" title="Adds an option item.">addItem(const WString&amp;)</a>, <a class="el" href="classWt_1_1WComboBox.html#95db6ec7468a1eabbf95f7eba3012a54" title="Removes the item at the specified position.">removeItem(int)</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="95db6ec7468a1eabbf95f7eba3012a54"></a><!-- doxytag: member="Wt::WComboBox::removeItem" ref="95db6ec7468a1eabbf95f7eba3012a54" args="(int index)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WComboBox::removeItem           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>index</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Removes the item at the specified position. 
<p>
The item is removed from the underlying model. This requires that the <a class="el" href="classWt_1_1WComboBox.html#20b54b2271b0219c2375775538d454a3" title="Returns the data model.">model()</a> is editable.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#2092c15c7c0c2f77342d0abdc393ca6b" title="Inserts an item at the specified position.">insertItem(int index, const WString&amp;)</a>, <a class="el" href="classWt_1_1WComboBox.html#0ed207e9616b51089d97030cc767409d" title="Clears all items.">clear()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="903e2d98c6860fe09198bdb43f0566bd"></a><!-- doxytag: member="Wt::WComboBox::setCurrentIndex" ref="903e2d98c6860fe09198bdb43f0566bd" args="(int index)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WComboBox::setCurrentIndex           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>index</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Changes the current selection. 
<p>
Specify a value of -1 for <code>index</code> to clear the selection. 
</div>
</div><p>
<a class="anchor" name="8eafbaa6e87ca46a411b904b78b12db6"></a><!-- doxytag: member="Wt::WComboBox::setItemText" ref="8eafbaa6e87ca46a411b904b78b12db6" args="(int index, const WString &amp;text)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WComboBox::setItemText           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>text</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Changes the text for a specified option. 
<p>
The text for the item at position <code>index</code> is changed. This requires that the <a class="el" href="classWt_1_1WComboBox.html#20b54b2271b0219c2375775538d454a3" title="Returns the data model.">model()</a> is editable. 
</div>
</div><p>
<a class="anchor" name="ec0856e1bacf24fded9621054a0c357c"></a><!-- doxytag: member="Wt::WComboBox::currentText" ref="ec0856e1bacf24fded9621054a0c357c" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classWt_1_1WString.html">WString</a> Wt::WComboBox::currentText           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the text of the currently selected item. 
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#94b6a87121adab0abbf23562d35a716e" title="Returns the currently selected item.">currentIndex()</a>, <a class="el" href="classWt_1_1WComboBox.html#f787aa7aa37e2ce2eddb499c15db52a4" title="Returns the text of a particular item.">itemText(int) const</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="f787aa7aa37e2ce2eddb499c15db52a4"></a><!-- doxytag: member="Wt::WComboBox::itemText" ref="f787aa7aa37e2ce2eddb499c15db52a4" args="(int index) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classWt_1_1WString.html">WString</a> Wt::WComboBox::itemText           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>index</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the text of a particular item. 
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#8eafbaa6e87ca46a411b904b78b12db6" title="Changes the text for a specified option.">setItemText(int, const WString&amp;)</a>, <a class="el" href="classWt_1_1WComboBox.html#ec0856e1bacf24fded9621054a0c357c" title="Returns the text of the currently selected item.">currentText()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="3d10438b053fe43dcd05e66b7ca78826"></a><!-- doxytag: member="Wt::WComboBox::setModel" ref="3d10438b053fe43dcd05e66b7ca78826" args="(WAbstractItemModel *model)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WComboBox::setModel           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1WAbstractItemModel.html">WAbstractItemModel</a> *&nbsp;</td>
          <td class="paramname"> <em>model</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets the model to be used for the items. 
<p>
The <code>model</code> may not be 0, and ownership of the model is not transferred.<p>
The default value is a <a class="el" href="classWt_1_1WStringListModel.html" title="An model that manages a list of strings.">WStringListModel</a> that is owned by the combo box.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#5d33b665d2fa12b349fa2783ba4d2033" title="Sets the column in the model to be used for the items.">setModelColumn(int)</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="5d33b665d2fa12b349fa2783ba4d2033"></a><!-- doxytag: member="Wt::WComboBox::setModelColumn" ref="5d33b665d2fa12b349fa2783ba4d2033" args="(int index)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WComboBox::setModelColumn           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>index</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets the column in the model to be used for the items. 
<p>
The column <code>index</code> in the model will be used to retrieve data.<p>
The default value is 0.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#3d10438b053fe43dcd05e66b7ca78826" title="Sets the model to be used for the items.">setModel()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="20b54b2271b0219c2375775538d454a3"></a><!-- doxytag: member="Wt::WComboBox::model" ref="20b54b2271b0219c2375775538d454a3" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1WAbstractItemModel.html">WAbstractItemModel</a>* Wt::WComboBox::model           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the data model. 
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#3d10438b053fe43dcd05e66b7ca78826" title="Sets the model to be used for the items.">setModel()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="ea94ab9c31cd5030906d73a8134e6e00"></a><!-- doxytag: member="Wt::WComboBox::refresh" ref="ea94ab9c31cd5030906d73a8134e6e00" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WComboBox::refresh           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Refresh the widget. 
<p>
The refresh method is invoked when the locale is changed using <a class="el" href="classWt_1_1WApplication.html#5c9cc1350019d69f154a2b44cdaf2596" title="Changes the locale.">WApplication::setLocale()</a> or when the user hit the refresh button.<p>
The widget must actualize its contents in response. 
<p>Reimplemented from <a class="el" href="classWt_1_1WWebWidget.html#8d0b7883f2f77a0c24b8fb911a8086a8">Wt::WWebWidget</a>.</p>

</div>
</div><p>
<a class="anchor" name="0ed207e9616b51089d97030cc767409d"></a><!-- doxytag: member="Wt::WComboBox::clear" ref="0ed207e9616b51089d97030cc767409d" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WComboBox::clear           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Clears all items. 
<p>
Removes all items from the underlying model. This requires that the <a class="el" href="classWt_1_1WComboBox.html#20b54b2271b0219c2375775538d454a3" title="Returns the data model.">model()</a> is editable. 
</div>
</div><p>
<a class="anchor" name="c39b46ccd8134a5397b4cbd87dc9f01f"></a><!-- doxytag: member="Wt::WComboBox::activated" ref="c39b46ccd8134a5397b4cbd87dc9f01f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1Signal.html">Signal</a>&lt;int&gt;&amp; Wt::WComboBox::activated           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Signal emitted when the selection changed. 
<p>
The newly selected item is passed as an argument.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#06401499734540c65db26fceb60bfdbf" title="Signal emitted when the selection changed.">sactivated()</a>, <a class="el" href="classWt_1_1WComboBox.html#94b6a87121adab0abbf23562d35a716e" title="Returns the currently selected item.">currentIndex()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="06401499734540c65db26fceb60bfdbf"></a><!-- doxytag: member="Wt::WComboBox::sactivated" ref="06401499734540c65db26fceb60bfdbf" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1Signal.html">Signal</a>&lt;<a class="el" href="classWt_1_1WString.html">WString</a>&gt;&amp; Wt::WComboBox::sactivated           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Signal emitted when the selection changed. 
<p>
The newly selected text is passed as an argument.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#c39b46ccd8134a5397b4cbd87dc9f01f" title="Signal emitted when the selection changed.">activated()</a>, <a class="el" href="classWt_1_1WComboBox.html#ec0856e1bacf24fded9621054a0c357c" title="Returns the text of the currently selected item.">currentText()</a> </dd></dl>

</div>
</div><p>
</div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:06 2010 for <a href="http://www.webtoolkit.eu/wt/">Wt</a> by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
</body>
</html>