<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Wt: Wt::WComboBox Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Wt  <span id="projectnumber">3.2.3</span> </div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.7.5.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related 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> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="inherits.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespaceWt.html">Wt</a> </li> <li class="navelem"><a class="el" href="classWt_1_1WComboBox.html">WComboBox</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> </div> <div class="headertitle"> <div class="title">Wt::WComboBox Class Reference<div class="ingroups"><a class="el" href="group__modelview.html">Model/view system</a></div></div> </div> </div> <div class="contents"> <!-- doxytag: class="Wt::WComboBox" --><!-- doxytag: inherits="Wt::WFormWidget" --> <p>A widget that provides a drop-down combo-box control. <a href="classWt_1_1WComboBox.html#details">More...</a></p> <p><code>#include <Wt/WComboBox></code></p> <div class="dynheader"> Inheritance diagram for Wt::WComboBox:</div> <div class="dyncontent"> <div class="center"><img src="classWt_1_1WComboBox__inherit__graph.png" border="0" usemap="#Wt_1_1WComboBox_inherit__map" alt="Inheritance graph"/></div> <map name="Wt_1_1WComboBox_inherit__map" id="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,145,480"/><area shape="rect" href="classWt_1_1WFormWidget.html" title="An abstract widget that corresponds to an HTML form element." alt="" coords="12,304,143,331"/><area shape="rect" href="classWt_1_1WInteractWidget.html" title="An abstract widget that can receive user-interface interaction." alt="" coords="5,229,149,256"/><area shape="rect" href="classWt_1_1WWebWidget.html" title="A base class for widgets with an HTML counterpart." alt="" coords="13,155,141,181"/><area shape="rect" href="classWt_1_1WWidget.html" title="The abstract base class for a user-interface component." alt="" coords="28,80,127,107"/><area shape="rect" href="classWt_1_1WObject.html" title="A base class for objects that participate in the signal/slot system." alt="" coords="29,5,125,32"/></map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="classWt_1_1WComboBox-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0403b5ef9b90f4868a3177245f0bbb62"></a><!-- doxytag: member="Wt::WComboBox::WComboBox" ref="a0403b5ef9b90f4868a3177245f0bbb62" args="(WContainerWidget *parent=0)" -->  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#a0403b5ef9b90f4868a3177245f0bbb62">WComboBox</a> (<a class="el" href="classWt_1_1WContainerWidget.html">WContainerWidget</a> *parent=0)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates an empty combo-box with optional <em>parent</em>. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#a9b2308a7d962ceb17c1ee32627b106d4">addItem</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &text)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds an option item. <a href="#a9b2308a7d962ceb17c1ee32627b106d4"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a58fff2a9bd76213f107cbc776e15112e"></a><!-- doxytag: member="Wt::WComboBox::count" ref="a58fff2a9bd76213f107cbc776e15112e" args="() const " --> int </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#a58fff2a9bd76213f107cbc776e15112e">count</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of items. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#a94b6a87121adab0abbf23562d35a716e">currentIndex</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the currently selected item. <a href="#a94b6a87121adab0abbf23562d35a716e"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#a2092c15c7c0c2f77342d0abdc393ca6b">insertItem</a> (int index, const <a class="el" href="classWt_1_1WString.html">WString</a> &text)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Inserts an item at the specified position. <a href="#a2092c15c7c0c2f77342d0abdc393ca6b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#a95db6ec7468a1eabbf95f7eba3012a54">removeItem</a> (int index)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Removes the item at the specified position. <a href="#a95db6ec7468a1eabbf95f7eba3012a54"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#a903e2d98c6860fe09198bdb43f0566bd">setCurrentIndex</a> (int index)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Changes the current selection. <a href="#a903e2d98c6860fe09198bdb43f0566bd"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#a8eafbaa6e87ca46a411b904b78b12db6">setItemText</a> (int index, const <a class="el" href="classWt_1_1WString.html">WString</a> &text)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Changes the text for a specified option. <a href="#a8eafbaa6e87ca46a411b904b78b12db6"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#aec0856e1bacf24fded9621054a0c357c">currentText</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the text of the currently selected item. <a href="#aec0856e1bacf24fded9621054a0c357c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#af787aa7aa37e2ce2eddb499c15db52a4">itemText</a> (int index) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the text of a particular item. <a href="#af787aa7aa37e2ce2eddb499c15db52a4"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#a3d10438b053fe43dcd05e66b7ca78826">setModel</a> (<a class="el" href="classWt_1_1WAbstractItemModel.html">WAbstractItemModel</a> *model)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the model to be used for the items. <a href="#a3d10438b053fe43dcd05e66b7ca78826"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#a5d33b665d2fa12b349fa2783ba4d2033">setModelColumn</a> (int index)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the column in the model to be used for the items. <a href="#a5d33b665d2fa12b349fa2783ba4d2033"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classWt_1_1WAbstractItemModel.html">WAbstractItemModel</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#a20b54b2271b0219c2375775538d454a3">model</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the data model. <a href="#a20b54b2271b0219c2375775538d454a3"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a98d44c32191d2cc80be14da1bf6acb3a"></a><!-- doxytag: member="Wt::WComboBox::findText" ref="a98d44c32191d2cc80be14da1bf6acb3a" args="(const WString &text, WFlags< MatchFlag > flags=MatchExactly|MatchCaseSensitive)" --> int </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#a98d44c32191d2cc80be14da1bf6acb3a">findText</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &text, WFlags< <a class="el" href="group__modelview.html#gaad8dd5072a40c11a34ee548bfb20b2ba">MatchFlag</a> > flags=MatchExactly|MatchCaseSensitive)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the index of the first item that matches a text. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#aab8a2c3f1dda8809f8ba43b7590fca93">valueText</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the current value. <a href="#aab8a2c3f1dda8809f8ba43b7590fca93"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#ab6cb87ce4b20eca33f8e70cf2b71973c">setValueText</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &value)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the current value. <a href="#ab6cb87ce4b20eca33f8e70cf2b71973c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#aea94ab9c31cd5030906d73a8134e6e00">refresh</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Refresh the widget. <a href="#aea94ab9c31cd5030906d73a8134e6e00"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#a0ed207e9616b51089d97030cc767409d">clear</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Clears all items. <a href="#a0ed207e9616b51089d97030cc767409d"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classWt_1_1Signal.html">Signal</a>< int > & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#ac39b46ccd8134a5397b4cbd87dc9f01f">activated</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Signal emitted when the selection changed. <a href="#ac39b46ccd8134a5397b4cbd87dc9f01f"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classWt_1_1Signal.html">Signal</a>< <a class="el" href="classWt_1_1WString.html">WString</a> > & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WComboBox.html#a06401499734540c65db26fceb60bfdbf">sactivated</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Signal emitted when the selection changed. <a href="#a06401499734540c65db26fceb60bfdbf"></a><br/></td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>A widget that provides a drop-down combo-box control. </p> <p>A combo box provides the user with a set of options, from which one option may be selected.</p> <p>WComboBox is an MVC view class, using a simple string list model by default. The model may be populated using <a class="el" href="classWt_1_1WComboBox.html#a9b2308a7d962ceb17c1ee32627b106d4" title="Adds an option item.">addItem(const WString&)</a> or <a class="el" href="classWt_1_1WComboBox.html#a2092c15c7c0c2f77342d0abdc393ca6b" title="Inserts an item at the specified position.">insertItem(int, const WString&)</a> and the contents can be cleared through <a class="el" href="classWt_1_1WComboBox.html#a0ed207e9616b51089d97030cc767409d" title="Clears all items.">clear()</a>. These methods manipulate the underlying <a class="el" href="classWt_1_1WComboBox.html#a20b54b2271b0219c2375775538d454a3" title="Returns the data model.">model()</a>.</p> <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#a3d10438b053fe43dcd05e66b7ca78826" title="Sets the model to be used for the items.">setModel()</a>.</p> <p>To react to selection events, connect to the <a class="el" href="classWt_1_1WFormWidget.html#a5216ba1594b5dc525cc47cad593c7ba8" title="Signal emitted when the value was changed.">changed()</a>, <a class="el" href="classWt_1_1WComboBox.html#ac39b46ccd8134a5397b4cbd87dc9f01f" title="Signal emitted when the selection changed.">activated()</a> or <a class="el" href="classWt_1_1WComboBox.html#a06401499734540c65db26fceb60bfdbf" title="Signal emitted when the selection changed.">sactivated()</a> signals.</p> <p>At all times, the current selection index is available through <a class="el" href="classWt_1_1WComboBox.html#a94b6a87121adab0abbf23562d35a716e" title="Returns the currently selected item.">currentIndex()</a> and the current selection text using <a class="el" href="classWt_1_1WComboBox.html#aec0856e1bacf24fded9621054a0c357c" title="Returns the text of the currently selected item.">currentText()</a>.</p> <p><a class="el" href="classWt_1_1WComboBox.html" title="A widget that provides a drop-down combo-box control.">WComboBox</a> does not have support for auto-completion, this behaviour can be found in the <a class="el" href="classWt_1_1WSuggestionPopup.html" title="A widget which popups to assist in editing a textarea or lineedit.">WSuggestionPopup</a>.</p> <p>Usage example: </p> <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#a0403b5ef9b90f4868a3177245f0bbb62" title="Creates an empty combo-box with optional parent.">Wt::WComboBox</a>(<span class="keyword">this</span>); combo-><a class="code" href="classWt_1_1WComboBox.html#a9b2308a7d962ceb17c1ee32627b106d4" title="Adds an option item.">addItem</a>(<span class="stringliteral">"Clint Eastwood"</span>); combo-><a class="code" href="classWt_1_1WComboBox.html#a9b2308a7d962ceb17c1ee32627b106d4" title="Adds an option item.">addItem</a>(<span class="stringliteral">"Mick Jagger"</span>); combo-><a class="code" href="classWt_1_1WComboBox.html#a9b2308a7d962ceb17c1ee32627b106d4" title="Adds an option item.">addItem</a>(<span class="stringliteral">"Johnny Depp"</span>); combo-><a class="code" href="classWt_1_1WComboBox.html#a9b2308a7d962ceb17c1ee32627b106d4" title="Adds an option item.">addItem</a>(<span class="stringliteral">"Kate Winslet"</span>); combo-><a class="code" href="classWt_1_1WComboBox.html#a903e2d98c6860fe09198bdb43f0566bd" title="Changes the current selection.">setCurrentIndex</a>(2); <span class="comment">// Johnny Depp</span> combo-><a class="code" href="classWt_1_1WComboBox.html#ac39b46ccd8134a5397b4cbd87dc9f01f" title="Signal emitted when the selection changed.">activated</a>().connect(<span class="keyword">this</span>, &MyWidget::comboChanged); </pre></div><p>WComboBox is an <a class="el" href="classWt_1_1WWidget.html#ac78e3af143883334c82031790c87416e">inline </a> widget.</p> <h3>CSS</h3> <p>The widget corresponds to the HTML <code><select></code> tag and does not provide styling. It can be styled using inline or external CSS as appropriate. </p> </div><hr/><h2>Member Function Documentation</h2> <a class="anchor" id="ac39b46ccd8134a5397b4cbd87dc9f01f"></a><!-- doxytag: member="Wt::WComboBox::activated" ref="ac39b46ccd8134a5397b4cbd87dc9f01f" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classWt_1_1Signal.html">Signal</a><int>& Wt::WComboBox::activated </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Signal emitted when the selection changed. </p> <p>The newly selected item is passed as an argument.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#a06401499734540c65db26fceb60bfdbf" title="Signal emitted when the selection changed.">sactivated()</a>, <a class="el" href="classWt_1_1WComboBox.html#a94b6a87121adab0abbf23562d35a716e" title="Returns the currently selected item.">currentIndex()</a> </dd></dl> </div> </div> <a class="anchor" id="a9b2308a7d962ceb17c1ee32627b106d4"></a><!-- doxytag: member="Wt::WComboBox::addItem" ref="a9b2308a7d962ceb17c1ee32627b106d4" args="(const WString &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> & </td> <td class="paramname"><em>text</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Adds an option item. </p> <p>Equivalent to <a class="el" href="classWt_1_1WComboBox.html#a2092c15c7c0c2f77342d0abdc393ca6b">insertItem</a> (<a class="el" href="classWt_1_1WComboBox.html#a58fff2a9bd76213f107cbc776e15112e" title="Returns the number of items.">count()</a>, <code>text</code>). </p> </div> </div> <a class="anchor" id="a0ed207e9616b51089d97030cc767409d"></a><!-- doxytag: member="Wt::WComboBox::clear" ref="a0ed207e9616b51089d97030cc767409d" 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>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Clears all items. </p> <p>Removes all items from the underlying model. This requires that the <a class="el" href="classWt_1_1WComboBox.html#a20b54b2271b0219c2375775538d454a3" title="Returns the data model.">model()</a> is editable. </p> </div> </div> <a class="anchor" id="a94b6a87121adab0abbf23562d35a716e"></a><!-- doxytag: member="Wt::WComboBox::currentIndex" ref="a94b6a87121adab0abbf23562d35a716e" 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>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Returns the currently selected item. </p> <p>If no item is currently selected, the method returns -1.</p> <p>The default value is 0, unless the combo box is empty. </p> </div> </div> <a class="anchor" id="aec0856e1bacf24fded9621054a0c357c"></a><!-- doxytag: member="Wt::WComboBox::currentText" ref="aec0856e1bacf24fded9621054a0c357c" 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>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Returns the text of the currently selected item. </p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#a94b6a87121adab0abbf23562d35a716e" title="Returns the currently selected item.">currentIndex()</a>, <a class="el" href="classWt_1_1WComboBox.html#af787aa7aa37e2ce2eddb499c15db52a4" title="Returns the text of a particular item.">itemText(int) const</a> </dd></dl> </div> </div> <a class="anchor" id="a2092c15c7c0c2f77342d0abdc393ca6b"></a><!-- doxytag: member="Wt::WComboBox::insertItem" ref="a2092c15c7c0c2f77342d0abdc393ca6b" args="(int index, const WString &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 </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> & </td> <td class="paramname"><em>text</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Inserts an item at the specified position. </p> <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#a20b54b2271b0219c2375775538d454a3" title="Returns the data model.">model()</a> is editable.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#a9b2308a7d962ceb17c1ee32627b106d4" title="Adds an option item.">addItem(const WString&)</a>, <a class="el" href="classWt_1_1WComboBox.html#a95db6ec7468a1eabbf95f7eba3012a54" title="Removes the item at the specified position.">removeItem(int)</a> </dd></dl> </div> </div> <a class="anchor" id="af787aa7aa37e2ce2eddb499c15db52a4"></a><!-- doxytag: member="Wt::WComboBox::itemText" ref="af787aa7aa37e2ce2eddb499c15db52a4" 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 </td> <td class="paramname"><em>index</em></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Returns the text of a particular item. </p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#a8eafbaa6e87ca46a411b904b78b12db6" title="Changes the text for a specified option.">setItemText(int, const WString&)</a>, <a class="el" href="classWt_1_1WComboBox.html#aec0856e1bacf24fded9621054a0c357c" title="Returns the text of the currently selected item.">currentText()</a> </dd></dl> </div> </div> <a class="anchor" id="a20b54b2271b0219c2375775538d454a3"></a><!-- doxytag: member="Wt::WComboBox::model" ref="a20b54b2271b0219c2375775538d454a3" 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>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Returns the data model. </p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#a3d10438b053fe43dcd05e66b7ca78826" title="Sets the model to be used for the items.">setModel()</a> </dd></dl> </div> </div> <a class="anchor" id="aea94ab9c31cd5030906d73a8134e6e00"></a><!-- doxytag: member="Wt::WComboBox::refresh" ref="aea94ab9c31cd5030906d73a8134e6e00" 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>)</td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Refresh the widget. </p> <p>The refresh method is invoked when the locale is changed using <a class="el" href="classWt_1_1WApplication.html#a5c9cc1350019d69f154a2b44cdaf2596" title="Changes the locale.">WApplication::setLocale()</a> or when the user hit the refresh button.</p> <p>The widget must actualize its contents in response. </p> <p>Reimplemented from <a class="el" href="classWt_1_1WFormWidget.html#a0d96e013a6d123df4d5ae90457287cec">Wt::WFormWidget</a>.</p> </div> </div> <a class="anchor" id="a95db6ec7468a1eabbf95f7eba3012a54"></a><!-- doxytag: member="Wt::WComboBox::removeItem" ref="a95db6ec7468a1eabbf95f7eba3012a54" 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 </td> <td class="paramname"><em>index</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Removes the item at the specified position. </p> <p>The item is removed from the underlying model. This requires that the <a class="el" href="classWt_1_1WComboBox.html#a20b54b2271b0219c2375775538d454a3" title="Returns the data model.">model()</a> is editable.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#a2092c15c7c0c2f77342d0abdc393ca6b" title="Inserts an item at the specified position.">insertItem(int index, const WString&)</a>, <a class="el" href="classWt_1_1WComboBox.html#a0ed207e9616b51089d97030cc767409d" title="Clears all items.">clear()</a> </dd></dl> </div> </div> <a class="anchor" id="a06401499734540c65db26fceb60bfdbf"></a><!-- doxytag: member="Wt::WComboBox::sactivated" ref="a06401499734540c65db26fceb60bfdbf" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classWt_1_1Signal.html">Signal</a><<a class="el" href="classWt_1_1WString.html">WString</a>>& Wt::WComboBox::sactivated </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Signal emitted when the selection changed. </p> <p>The newly selected text is passed as an argument.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#ac39b46ccd8134a5397b4cbd87dc9f01f" title="Signal emitted when the selection changed.">activated()</a>, <a class="el" href="classWt_1_1WComboBox.html#aec0856e1bacf24fded9621054a0c357c" title="Returns the text of the currently selected item.">currentText()</a> </dd></dl> </div> </div> <a class="anchor" id="a903e2d98c6860fe09198bdb43f0566bd"></a><!-- doxytag: member="Wt::WComboBox::setCurrentIndex" ref="a903e2d98c6860fe09198bdb43f0566bd" 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 </td> <td class="paramname"><em>index</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Changes the current selection. </p> <p>Specify a value of -1 for <code>index</code> to clear the selection. </p> </div> </div> <a class="anchor" id="a8eafbaa6e87ca46a411b904b78b12db6"></a><!-- doxytag: member="Wt::WComboBox::setItemText" ref="a8eafbaa6e87ca46a411b904b78b12db6" args="(int index, const WString &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 </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> & </td> <td class="paramname"><em>text</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Changes the text for a specified option. </p> <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#a20b54b2271b0219c2375775538d454a3" title="Returns the data model.">model()</a> is editable. </p> </div> </div> <a class="anchor" id="a3d10438b053fe43dcd05e66b7ca78826"></a><!-- doxytag: member="Wt::WComboBox::setModel" ref="a3d10438b053fe43dcd05e66b7ca78826" 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> * </td> <td class="paramname"><em>model</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Sets the model to be used for the items. </p> <p>The <code>model</code> may not be 0, and ownership of the model is not transferred.</p> <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"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#a5d33b665d2fa12b349fa2783ba4d2033" title="Sets the column in the model to be used for the items.">setModelColumn(int)</a> </dd></dl> </div> </div> <a class="anchor" id="a5d33b665d2fa12b349fa2783ba4d2033"></a><!-- doxytag: member="Wt::WComboBox::setModelColumn" ref="a5d33b665d2fa12b349fa2783ba4d2033" 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 </td> <td class="paramname"><em>index</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Sets the column in the model to be used for the items. </p> <p>The column <code>index</code> in the model will be used to retrieve data.</p> <p>The default value is 0.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WComboBox.html#a3d10438b053fe43dcd05e66b7ca78826" title="Sets the model to be used for the items.">setModel()</a> </dd></dl> </div> </div> <a class="anchor" id="ab6cb87ce4b20eca33f8e70cf2b71973c"></a><!-- doxytag: member="Wt::WComboBox::setValueText" ref="ab6cb87ce4b20eca33f8e70cf2b71973c" args="(const WString &value)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::WComboBox::setValueText </td> <td>(</td> <td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> & </td> <td class="paramname"><em>value</em></td><td>)</td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Sets the current value. </p> <p>Sets the current index to the item corresponding to <code>value</code>. </p> <p>Implements <a class="el" href="classWt_1_1WFormWidget.html#a129d31b145f2614f608a852ca4e91731">Wt::WFormWidget</a>.</p> </div> </div> <a class="anchor" id="aab8a2c3f1dda8809f8ba43b7590fca93"></a><!-- doxytag: member="Wt::WComboBox::valueText" ref="aab8a2c3f1dda8809f8ba43b7590fca93" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> Wt::WComboBox::valueText </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the current value. </p> <p>Returns <a class="el" href="classWt_1_1WComboBox.html#aec0856e1bacf24fded9621054a0c357c" title="Returns the text of the currently selected item.">currentText()</a> converted from a <a class="el" href="classWt_1_1WString.html" title="A value class which describes a locale-aware unicode string.">WString</a> to a string. </p> <p>Implements <a class="el" href="classWt_1_1WFormWidget.html#a9e1ffd440abc07ce883d0a7b1a3883f6">Wt::WFormWidget</a>.</p> </div> </div> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr size="1"><address style="text-align: right; margin: 3px"><small> Generated on Thu Nov 1 2012 for <a href="http://www.webtoolkit.eu/wt">the C++ Web Toolkit (Wt)</a> by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" border="0" style="vertical-align: middle; display: inline-block; height: 2em"></a> 1.7.5.1</small></address> </body> </html>