Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > b3a1f4d91c26f535919e39e25606614a > files > 2130

wt-doc-3.2.3-1.fc18.noarch.rpm

<!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::WSuggestionPopup 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
   &#160;<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&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;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&#160;List</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;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_1WSuggestionPopup.html">WSuggestionPopup</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Wt::WSuggestionPopup 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::WSuggestionPopup" --><!-- doxytag: inherits="Wt::WCompositeWidget" -->
<p>A widget which popups to assist in editing a textarea or lineedit.  
 <a href="classWt_1_1WSuggestionPopup.html#details">More...</a></p>

<p><code>#include &lt;Wt/WSuggestionPopup&gt;</code></p>
<div class="dynheader">
Inheritance diagram for Wt::WSuggestionPopup:</div>
<div class="dyncontent">
<div class="center"><img src="classWt_1_1WSuggestionPopup__inherit__graph.png" border="0" usemap="#Wt_1_1WSuggestionPopup_inherit__map" alt="Inheritance graph"/></div>
<map name="Wt_1_1WSuggestionPopup_inherit__map" id="Wt_1_1WSuggestionPopup_inherit__map">
<area shape="rect" href="classWt_1_1WCompositeWidget.html" title="A widget that hides the implementation of composite widgets." alt="" coords="5,155,168,181"/><area shape="rect" href="classWt_1_1WWidget.html" title="The abstract base class for a user&#45;interface component." alt="" coords="37,80,136,107"/><area shape="rect" href="classWt_1_1WObject.html" title="A base class for objects that participate in the signal/slot system." alt="" coords="39,5,135,32"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classWt_1_1WSuggestionPopup-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structWt_1_1WSuggestionPopup_1_1Options.html">Options</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A configuration object to generate a matcher and replacer JavaScript function.  <a href="structWt_1_1WSuggestionPopup_1_1Options.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a7cad80c92d68c8396d82670be1a4bc69">PopupTrigger</a> { <a class="el" href="classWt_1_1WSuggestionPopup.html#a7cad80c92d68c8396d82670be1a4bc69a21a91e46a3a341cfa7c6883a77c7c272">Editing</a> =  0x1, 
<a class="el" href="classWt_1_1WSuggestionPopup.html#a7cad80c92d68c8396d82670be1a4bc69a3eb6dd8408d1213104f8b4720b6e6836">DropDownIcon</a> =  0x2
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enumeration that defines a trigger for showing the popup.  <a href="classWt_1_1WSuggestionPopup.html#a7cad80c92d68c8396d82670be1a4bc69">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a854886c83fd73cdb5f3c338cc0baf6a5">WSuggestionPopup</a> (const <a class="el" href="structWt_1_1WSuggestionPopup_1_1Options.html">Options</a> &amp;options, <a class="el" href="classWt_1_1WContainerWidget.html">WContainerWidget</a> *parent=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a suggestion popup.  <a href="#a854886c83fd73cdb5f3c338cc0baf6a5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a2ddf4c97fa85c77de4c76cbca24951bb">WSuggestionPopup</a> (const std::string &amp;matcherJS, const std::string &amp;replacerJS, <a class="el" href="classWt_1_1WContainerWidget.html">WContainerWidget</a> *parent=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a suggestion popup with given matcherJS and replacerJS.  <a href="#a2ddf4c97fa85c77de4c76cbca24951bb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a56813832a386cdc93a0e70b0d0aa5f92">forEdit</a> (<a class="el" href="classWt_1_1WFormWidget.html">WFormWidget</a> *edit, WFlags&lt; <a class="el" href="classWt_1_1WSuggestionPopup.html#a7cad80c92d68c8396d82670be1a4bc69">PopupTrigger</a> &gt; popupTriggers=Editing)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Lets this suggestion popup assist in editing an edit field.  <a href="#a56813832a386cdc93a0e70b0d0aa5f92"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#ad8e85625b9309639222ed1893c57713a">removeEdit</a> (<a class="el" href="classWt_1_1WFormWidget.html">WFormWidget</a> *edit)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes the edit field from the list of assisted editors.  <a href="#ad8e85625b9309639222ed1893c57713a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a0dd2b20a4a1505d464a8213585bbc4d3">showAt</a> (<a class="el" href="classWt_1_1WFormWidget.html">WFormWidget</a> *edit)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Shows the suggestion popup at an edit field.  <a href="#a0dd2b20a4a1505d464a8213585bbc4d3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a0beae292354fa79c2bbe68e9b11c8f01">clearSuggestions</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the list of suggestions.  <a href="#a0beae292354fa79c2bbe68e9b11c8f01"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#aff509867327911ed93445c56231680fb">addSuggestion</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;suggestionText, const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;suggestionValue)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a new suggestion.  <a href="#aff509867327911ed93445c56231680fb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a4b4e3dcc77433195c5439ab86ac5d95c">setModel</a> (<a class="el" href="classWt_1_1WAbstractItemModel.html">WAbstractItemModel</a> *model)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the model to be used for the suggestions.  <a href="#a4b4e3dcc77433195c5439ab86ac5d95c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classWt_1_1WAbstractItemModel.html">WAbstractItemModel</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a7fa2fe71e41607f45feffa8f14697db4">model</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the data model.  <a href="#a7fa2fe71e41607f45feffa8f14697db4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a6616d230bad6511bc40d3bf2c1e4ec84">setModelColumn</a> (int index)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the column in the model to be used for the items.  <a href="#a6616d230bad6511bc40d3bf2c1e4ec84"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a9ebf63d4048a9662c3e05ae6be162993">setDefaultIndex</a> (int row)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a default selected value.  <a href="#a9ebf63d4048a9662c3e05ae6be162993"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a9533638edb1114a703fe0617cbe67921">defaultIndex</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the default value.  <a href="#a9533638edb1114a703fe0617cbe67921"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a8a77e3397fa98db0639fca3b1c94a8a2">setFilterLength</a> (int count)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the minimum input length before showing the popup.  <a href="#a8a77e3397fa98db0639fca3b1c94a8a2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a6f06ad67c94d06f1ef7d73ec2c51de39">filterLength</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the filter length.  <a href="#a6f06ad67c94d06f1ef7d73ec2c51de39"></a><br/></td></tr>
<tr><td class="memItemLeft" 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;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a4c7f8529e7d49fca2a10e95bdbbd9815">filterModel</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Signal that indicates that the model should be filtered.  <a href="#a4c7f8529e7d49fca2a10e95bdbbd9815"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classWt_1_1Signal.html">Signal</a>&lt; int, <a class="el" href="classWt_1_1WFormWidget.html">WFormWidget</a> * &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a63f0db2301510404922d7ed1572b92cc">activated</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Signal emitted when a suggestion was selected.  <a href="#a63f0db2301510404922d7ed1572b92cc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a20846bf7fb64c992a2f98904b482b1c4">setGlobalPopup</a> (bool global)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Controls how the suggestion popup is positioned.  <a href="#a20846bf7fb64c992a2f98904b482b1c4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#abd7500d03679e0190307a753d78085ec">setMaximumSize</a> (const <a class="el" href="classWt_1_1WLength.html">WLength</a> &amp;width, const <a class="el" href="classWt_1_1WLength.html">WLength</a> &amp;height)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a maximum size.  <a href="#abd7500d03679e0190307a753d78085ec"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a7db92809f8e5d3751d2a9bf446549497">setMinimumSize</a> (const <a class="el" href="classWt_1_1WLength.html">WLength</a> &amp;width, const <a class="el" href="classWt_1_1WLength.html">WLength</a> &amp;height)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a minimum size.  <a href="#a7db92809f8e5d3751d2a9bf446549497"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a415162037c68f38e4141264022b02489">generateMatcherJS</a> (const <a class="el" href="structWt_1_1WSuggestionPopup_1_1Options.html">Options</a> &amp;options)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a standard matcher JavaScript function.  <a href="#a415162037c68f38e4141264022b02489"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WSuggestionPopup.html#a58e9fd0c214cdc80170c42933af206aa">generateReplacerJS</a> (const <a class="el" href="structWt_1_1WSuggestionPopup_1_1Options.html">Options</a> &amp;options)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a standard replacer JavaScript function.  <a href="#a58e9fd0c214cdc80170c42933af206aa"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A widget which popups to assist in editing a textarea or lineedit. </p>
<p>This widget may be associated with one or more <a class="el" href="classWt_1_1WFormWidget.html">WFormWidgets</a> (typically a <a class="el" href="classWt_1_1WLineEdit.html" title="A widget that provides a single line edit.">WLineEdit</a> or a <a class="el" href="classWt_1_1WTextArea.html" title="A widget that provides a multi-line edit.">WTextArea</a>).</p>
<p>The popup provides the user with suggestions to enter input. The popup can be used by one or more editors, using <a class="el" href="classWt_1_1WSuggestionPopup.html#a56813832a386cdc93a0e70b0d0aa5f92" title="Lets this suggestion popup assist in editing an edit field.">forEdit()</a>. The popup will show when the user starts editing the edit field, or when the user opens the suggestions explicitly using a drop down icon or with the down key. The popup positions itself intelligently just below or just on top of the edit field. It offers a list of suggestions that match in some way with the current edit field, and dynamically adjusts this list. The implementation for matching individual suggestions with the current text is provided through a JavaScript function. This function may also highlight part(s) of the suggestions to provide feed-back on how they match.</p>
<p>WSuggestionPopup is an MVC view class, using a simple <a class="el" href="classWt_1_1WStringListModel.html" title="An model that manages a list of strings.">WStringListModel</a> by default. You can set a custom model using <a class="el" href="classWt_1_1WSuggestionPopup.html#a4b4e3dcc77433195c5439ab86ac5d95c" title="Sets the model to be used for the suggestions.">setModel()</a>. The model can provide different text for the suggestion text (<a class="el" href="group__modelview.html#gga0ae864e12320f9f89172735e075ed068a5ed17aded8a0e3b712698cf85a218f1f" title="Role for textual representation.">Wt::DisplayRole</a>) and value (<a class="el" href="group__modelview.html#gga0ae864e12320f9f89172735e075ed068a9b7eae9fc07ea4fd8afe7bc97954162c" title="First role reserved for user purposes.">Wt::UserRole</a>). The member methods <a class="el" href="classWt_1_1WSuggestionPopup.html#a0beae292354fa79c2bbe68e9b11c8f01" title="Clears the list of suggestions.">clearSuggestions()</a> and <a class="el" href="classWt_1_1WSuggestionPopup.html#aff509867327911ed93445c56231680fb" title="Adds a new suggestion.">addSuggestion()</a> manipulate this model. Note that a <a class="el" href="classWt_1_1WStringListModel.html" title="An model that manages a list of strings.">WStringListModel</a> does not support <a class="el" href="group__modelview.html#gga0ae864e12320f9f89172735e075ed068a9b7eae9fc07ea4fd8afe7bc97954162c" title="First role reserved for user purposes.">Wt::UserRole</a> data, so you may need to use a <a class="el" href="classWt_1_1WStandardItemModel.html" title="A standard data model, which stores its data in memory.">WStandardItemModel</a> instead.</p>
<p>By default, the popup implements all filtering client-side. To support large datasets, you may enable server-side filtering of suggestions based on the input. The server-side filtering may provide a coarse filtering using a fixed size prefix of the entered text, and complement the client-side filtering. To enable server-side filtering, use <a class="el" href="classWt_1_1WSuggestionPopup.html#a8a77e3397fa98db0639fca3b1c94a8a2" title="Sets the minimum input length before showing the popup.">setFilterLength()</a> and listen to filter notification using the modelFilter() signal. Whenever a filter event is generated you can adjust the model's content according to the filter (e.g. using a <a class="el" href="classWt_1_1WSortFilterProxyModel.html" title="A proxy model for Wt&#39;s item models that provides filtering and/or sorting.">WSortFilterProxyModel</a>). By using <a class="el" href="classWt_1_1WSuggestionPopup.html#abd7500d03679e0190307a753d78085ec" title="Sets a maximum size.">setMaximumSize()</a> you can also limit the maximum height of the popup, in which case scrolling is supported (similar to a combo-box).</p>
<p>The class is initialized with an <a class="el" href="structWt_1_1WSuggestionPopup_1_1Options.html" title="A configuration object to generate a matcher and replacer JavaScript function.">Options</a> struct which configures how suggestion filtering and result editing is done. Alternatively, you can provide two JavaScript functions, one for filtering the suggestions, and one for editing the value of the textarea when a suggestion is selected.</p>
<p>The matcherJS function must have the following JavaScript signature:</p>
<div class="fragment"><pre class="fragment"> <span class="keyword">function</span> (editElement) {
   <span class="comment">// fetch the location of cursor and current text in the editElement.</span>

   <span class="comment">// return a function that matches a given suggestion with the current value of the editElement.</span>
   <span class="keywordflow">return</span> <span class="keyword">function</span>(suggestion) {

     <span class="comment">// 1) if suggestion is null, simply return the current text &#39;value&#39;</span>
     <span class="comment">// 2) check suggestion if it matches</span>
     <span class="comment">// 3) add highlighting markup to suggestion if necessary</span>

     <span class="keywordflow">return</span> { match : ...,      <span class="comment">// does the suggestion match ? (boolean)</span>
              suggestion : ...  <span class="comment">// modified suggestion with highlighting</span>
             };
   }
 }
</pre></div><p>The replacerJS function that edits the value has the following JavaScript signature.</p>
<div class="fragment"><pre class="fragment"> <span class="keyword">function</span> (editElement, suggestionText, suggestionValue) {
   <span class="comment">// editElement is the form element which must be edited.</span>
   <span class="comment">// suggestionText is the displayed text for the matched suggestion.</span>
   <span class="comment">// suggestionValue is the stored value for the matched suggestion.</span>

   <span class="comment">// computed modifiedEditValue and modifiedPos ...</span>

   editElement.value = modifiedEditValue;
   editElement.selectionStart = edit.selectionEnd = modifiedPos;
 }
</pre></div><p>To style the suggestions, you should style the &lt;span&gt; element inside this widget, and the &lt;span&gt;."sel" element to style the current selection.</p>
<p>Usage example: </p>
<div class="fragment"><pre class="fragment"> <span class="comment">// options for email address suggestions</span>
 <a class="code" href="structWt_1_1WSuggestionPopup_1_1Options.html" title="A configuration object to generate a matcher and replacer JavaScript function.">Wt::WSuggestionPopup::Options</a> contactOptions
 = { <span class="stringliteral">&quot;&lt;b&gt;&quot;</span>,         <span class="comment">// highlightBeginTag</span>
     <span class="stringliteral">&quot;&lt;/b&gt;&quot;</span>,        <span class="comment">// highlightEndTag</span>
     <span class="charliteral">&#39;,&#39;</span>,           <span class="comment">// listSeparator      (for multiple addresses)</span>
     <span class="stringliteral">&quot; \\n&quot;</span>,        <span class="comment">// whitespace</span>
     <span class="stringliteral">&quot;-., \&quot;@\\n;&quot;</span>, <span class="comment">// wordSeparators     (within an address)</span>
     <span class="stringliteral">&quot;, &quot;</span>           <span class="comment">// appendReplacedText (prepare next email address)</span>
    };

 <a class="code" href="classWt_1_1WSuggestionPopup.html" title="A widget which popups to assist in editing a textarea or lineedit.">Wt::WSuggestionPopup</a> *popup = <span class="keyword">new</span> <a class="code" href="classWt_1_1WSuggestionPopup.html#a854886c83fd73cdb5f3c338cc0baf6a5" title="Creates a suggestion popup.">Wt::WSuggestionPopup</a>(contactOptions, <span class="keyword">this</span>);
 <a class="code" href="classWt_1_1WTextArea.html" title="A widget that provides a multi-line edit.">Wt::WTextArea</a> *textEdit = <span class="keyword">new</span> <a class="code" href="classWt_1_1WTextArea.html" title="A widget that provides a multi-line edit.">Wt::WTextArea</a>(<span class="keyword">this</span>);
 popup-&gt;<a class="code" href="classWt_1_1WSuggestionPopup.html#a56813832a386cdc93a0e70b0d0aa5f92" title="Lets this suggestion popup assist in editing an edit field.">forEdit</a>(textEdit);

 <span class="comment">// load popup data</span>
 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> i = 0; i &lt; contacts.size(); ++i)
   popup-&gt;<a class="code" href="classWt_1_1WSuggestionPopup.html#aff509867327911ed93445c56231680fb" title="Adds a new suggestion.">addSuggestion</a>(contacts[i].formatted(), contacts[i].formatted());
</pre></div><p>A screenshot of this example: </p>
<table  border="0" align="center">
<tr>
<td><div class="image">
<img src="WSuggestionPopup-default-1.png" alt="WSuggestionPopup-default-1.png"/>
<div class="caption">
An example WSuggestionPopup (default)</div></div>
  </td><td><div class="image">
<img src="WSuggestionPopup-polished-1.png" alt="WSuggestionPopup-polished-1.png"/>
<div class="caption">
An example WSuggestionPopup (polished)</div></div>
   </td></tr>
</table>
<h3>CSS</h3>
<p>The suggestion popup is styled by the current CSS theme. The look can be overridden using the <code>Wt-suggest</code> CSS class and the following selectors:</p>
<div class="fragment"><pre class="fragment">
.Wt-suggest .content div : A suggestion element
.Wt-suggest .sel :         A selected suggestion element
</pre></div><p>When using the DropDownIcon trigger, an additional style class is provided for the edit field: <code>Wt-suggest-dropdown</code>, which renders the icon to the right inside the edit field. This class may be used to customize how the drop down icon is rendered.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>This widget requires JavaScript support. </dd></dl>
</div><hr/><h2>Member Enumeration Documentation</h2>
<a class="anchor" id="a7cad80c92d68c8396d82670be1a4bc69"></a><!-- doxytag: member="Wt::WSuggestionPopup::PopupTrigger" ref="a7cad80c92d68c8396d82670be1a4bc69" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classWt_1_1WSuggestionPopup.html#a7cad80c92d68c8396d82670be1a4bc69">Wt::WSuggestionPopup::PopupTrigger</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Enumeration that defines a trigger for showing the popup. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WSuggestionPopup.html#a56813832a386cdc93a0e70b0d0aa5f92" title="Lets this suggestion popup assist in editing an edit field.">forEdit()</a> </dd></dl>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a7cad80c92d68c8396d82670be1a4bc69a21a91e46a3a341cfa7c6883a77c7c272"></a><!-- doxytag: member="Editing" ref="a7cad80c92d68c8396d82670be1a4bc69a21a91e46a3a341cfa7c6883a77c7c272" args="" -->Editing</em>&nbsp;</td><td>
<p>Shows popup when the user starts editing. </p>
<p>The popup is shown when the currently edited text has a length longer than the <a class="el" href="classWt_1_1WSuggestionPopup.html#a8a77e3397fa98db0639fca3b1c94a8a2">filter length</a>. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a7cad80c92d68c8396d82670be1a4bc69a3eb6dd8408d1213104f8b4720b6e6836"></a><!-- doxytag: member="DropDownIcon" ref="a7cad80c92d68c8396d82670be1a4bc69a3eb6dd8408d1213104f8b4720b6e6836" args="" -->DropDownIcon</em>&nbsp;</td><td>
<p>Shows popup when user clicks a drop down icon. </p>
<p>The lineedit is modified to show a drop down icon, and clicking the icon shows the suggestions, very much like a WComboCox. </p>
</td></tr>
</table>
</dd>
</dl>

</div>
</div>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a854886c83fd73cdb5f3c338cc0baf6a5"></a><!-- doxytag: member="Wt::WSuggestionPopup::WSuggestionPopup" ref="a854886c83fd73cdb5f3c338cc0baf6a5" args="(const Options &amp;options, WContainerWidget *parent=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Wt::WSuggestionPopup::WSuggestionPopup </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structWt_1_1WSuggestionPopup_1_1Options.html">Options</a> &amp;&#160;</td>
          <td class="paramname"><em>options</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classWt_1_1WContainerWidget.html">WContainerWidget</a> *&#160;</td>
          <td class="paramname"><em>parent</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a suggestion popup. </p>
<p>The popup using a standard matcher and replacer implementation that is configured using the provided <code>options</code>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WSuggestionPopup.html#a415162037c68f38e4141264022b02489" title="Creates a standard matcher JavaScript function.">generateMatcherJS()</a>, <a class="el" href="classWt_1_1WSuggestionPopup.html#a58e9fd0c214cdc80170c42933af206aa" title="Creates a standard replacer JavaScript function.">generateReplacerJS()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a2ddf4c97fa85c77de4c76cbca24951bb"></a><!-- doxytag: member="Wt::WSuggestionPopup::WSuggestionPopup" ref="a2ddf4c97fa85c77de4c76cbca24951bb" args="(const std::string &amp;matcherJS, const std::string &amp;replacerJS, WContainerWidget *parent=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Wt::WSuggestionPopup::WSuggestionPopup </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>matcherJS</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>replacerJS</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classWt_1_1WContainerWidget.html">WContainerWidget</a> *&#160;</td>
          <td class="paramname"><em>parent</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a suggestion popup with given matcherJS and replacerJS. </p>
<p>See supra for the expected signature of the matcher and replace JavaScript functions. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a63f0db2301510404922d7ed1572b92cc"></a><!-- doxytag: member="Wt::WSuggestionPopup::activated" ref="a63f0db2301510404922d7ed1572b92cc" 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, <a class="el" href="classWt_1_1WFormWidget.html">WFormWidget</a> *&gt;&amp; Wt::WSuggestionPopup::activated </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Signal emitted when a suggestion was selected. </p>
<p>The selected item is passed as the first argument and the editor as the second. </p>

</div>
</div>
<a class="anchor" id="aff509867327911ed93445c56231680fb"></a><!-- doxytag: member="Wt::WSuggestionPopup::addSuggestion" ref="aff509867327911ed93445c56231680fb" args="(const WString &amp;suggestionText, const WString &amp;suggestionValue)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WSuggestionPopup::addSuggestion </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;&#160;</td>
          <td class="paramname"><em>suggestionText</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;&#160;</td>
          <td class="paramname"><em>suggestionValue</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Adds a new suggestion. </p>
<p>This adds an entry to the underlying model. The <code>suggestionText</code> is set as <a class="el" href="group__modelview.html#gga0ae864e12320f9f89172735e075ed068a5ed17aded8a0e3b712698cf85a218f1f" title="Role for textual representation.">Wt::DisplayRole</a> and the <code>suggestionValue</code> (which is inserted into the edit field on selection) is set as <a class="el" href="group__modelview.html#gga0ae864e12320f9f89172735e075ed068a9b7eae9fc07ea4fd8afe7bc97954162c" title="First role reserved for user purposes.">Wt::UserRole</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WSuggestionPopup.html#a0beae292354fa79c2bbe68e9b11c8f01" title="Clears the list of suggestions.">clearSuggestions()</a>, <a class="el" href="classWt_1_1WSuggestionPopup.html#a4b4e3dcc77433195c5439ab86ac5d95c" title="Sets the model to be used for the suggestions.">setModel()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a0beae292354fa79c2bbe68e9b11c8f01"></a><!-- doxytag: member="Wt::WSuggestionPopup::clearSuggestions" ref="a0beae292354fa79c2bbe68e9b11c8f01" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WSuggestionPopup::clearSuggestions </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Clears the list of suggestions. </p>
<p>This clears the underlying model.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WSuggestionPopup.html#aff509867327911ed93445c56231680fb" title="Adds a new suggestion.">addSuggestion()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a9533638edb1114a703fe0617cbe67921"></a><!-- doxytag: member="Wt::WSuggestionPopup::defaultIndex" ref="a9533638edb1114a703fe0617cbe67921" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Wt::WSuggestionPopup::defaultIndex </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the default value. </p>
<dl class="see"><dt><b>See also:</b></dt><dd>setDefaultValue() </dd></dl>

</div>
</div>
<a class="anchor" id="a6f06ad67c94d06f1ef7d73ec2c51de39"></a><!-- doxytag: member="Wt::WSuggestionPopup::filterLength" ref="a6f06ad67c94d06f1ef7d73ec2c51de39" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Wt::WSuggestionPopup::filterLength </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the filter length. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WSuggestionPopup.html#a8a77e3397fa98db0639fca3b1c94a8a2" title="Sets the minimum input length before showing the popup.">setFilterLength()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a4c7f8529e7d49fca2a10e95bdbbd9815"></a><!-- doxytag: member="Wt::WSuggestionPopup::filterModel" ref="a4c7f8529e7d49fca2a10e95bdbbd9815" 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::WSuggestionPopup::filterModel </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Signal that indicates that the model should be filtered. </p>
<p>The argument is the initial input. When <a class="el" href="classWt_1_1WSuggestionPopup.html#a7cad80c92d68c8396d82670be1a4bc69a21a91e46a3a341cfa7c6883a77c7c272">Editing</a> is used as edit trigger, its length will always equal the <a class="el" href="classWt_1_1WSuggestionPopup.html#a6f06ad67c94d06f1ef7d73ec2c51de39" title="Returns the filter length.">filterLength()</a>. When <a class="el" href="classWt_1_1WSuggestionPopup.html#a7cad80c92d68c8396d82670be1a4bc69a3eb6dd8408d1213104f8b4720b6e6836">DropDownIcon</a> is used as edit trigger, the input length may be less than <a class="el" href="classWt_1_1WSuggestionPopup.html#a6f06ad67c94d06f1ef7d73ec2c51de39" title="Returns the filter length.">filterLength()</a>, and the the signal will be called repeatedly as the user provides more input.</p>
<p>For example, if you are using a <a class="el" href="classWt_1_1WSortFilterProxyModel.html" title="A proxy model for Wt&#39;s item models that provides filtering and/or sorting.">WSortFilterProxyModel</a>, you could react to this signal with: </p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> MyClass::filterSuggestions(<span class="keyword">const</span> WString&amp; filter)
 {
   proxyModel-&gt;setFilterRegExp(filter + <span class="stringliteral">&quot;.*&quot;</span>);
 }
</pre></div> 
</div>
</div>
<a class="anchor" id="a56813832a386cdc93a0e70b0d0aa5f92"></a><!-- doxytag: member="Wt::WSuggestionPopup::forEdit" ref="a56813832a386cdc93a0e70b0d0aa5f92" args="(WFormWidget *edit, WFlags&lt; PopupTrigger &gt; popupTriggers=Editing)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WSuggestionPopup::forEdit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1WFormWidget.html">WFormWidget</a> *&#160;</td>
          <td class="paramname"><em>edit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">WFlags&lt; <a class="el" href="classWt_1_1WSuggestionPopup.html#a7cad80c92d68c8396d82670be1a4bc69">PopupTrigger</a> &gt;&#160;</td>
          <td class="paramname"><em>popupTriggers</em> = <code>Editing</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Lets this suggestion popup assist in editing an edit field. </p>
<p>A single suggestion popup may assist in several edits by repeated calls of this method.</p>
<p>The <code>popupTriggers</code> control how editing is triggered (either by the user editing the field by entering keys or by an explicit drop down menu that is shown inside the edit).</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WSuggestionPopup.html#ad8e85625b9309639222ed1893c57713a" title="Removes the edit field from the list of assisted editors.">removeEdit()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a415162037c68f38e4141264022b02489"></a><!-- doxytag: member="Wt::WSuggestionPopup::generateMatcherJS" ref="a415162037c68f38e4141264022b02489" args="(const Options &amp;options)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string Wt::WSuggestionPopup::generateMatcherJS </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structWt_1_1WSuggestionPopup_1_1Options.html">Options</a> &amp;&#160;</td>
          <td class="paramname"><em>options</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a standard matcher JavaScript function. </p>
<p>This returns a JavaScript function that provides a standard implementation for the matching input, based on the given <code>options</code>. </p>

</div>
</div>
<a class="anchor" id="a58e9fd0c214cdc80170c42933af206aa"></a><!-- doxytag: member="Wt::WSuggestionPopup::generateReplacerJS" ref="a58e9fd0c214cdc80170c42933af206aa" args="(const Options &amp;options)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string Wt::WSuggestionPopup::generateReplacerJS </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structWt_1_1WSuggestionPopup_1_1Options.html">Options</a> &amp;&#160;</td>
          <td class="paramname"><em>options</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a standard replacer JavaScript function. </p>
<p>This returns a JavaScript function that provides a standard implementation for the matching input, based on the given <code>options</code>. </p>

</div>
</div>
<a class="anchor" id="a7fa2fe71e41607f45feffa8f14697db4"></a><!-- doxytag: member="Wt::WSuggestionPopup::model" ref="a7fa2fe71e41607f45feffa8f14697db4" 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::WSuggestionPopup::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_1WSuggestionPopup.html#a4b4e3dcc77433195c5439ab86ac5d95c" title="Sets the model to be used for the suggestions.">setModel()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ad8e85625b9309639222ed1893c57713a"></a><!-- doxytag: member="Wt::WSuggestionPopup::removeEdit" ref="ad8e85625b9309639222ed1893c57713a" args="(WFormWidget *edit)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WSuggestionPopup::removeEdit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1WFormWidget.html">WFormWidget</a> *&#160;</td>
          <td class="paramname"><em>edit</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Removes the edit field from the list of assisted editors. </p>
<p>The editor will no longer be assisted by this popup widget.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WSuggestionPopup.html#a56813832a386cdc93a0e70b0d0aa5f92" title="Lets this suggestion popup assist in editing an edit field.">forEdit()</a>. </dd></dl>

</div>
</div>
<a class="anchor" id="a9ebf63d4048a9662c3e05ae6be162993"></a><!-- doxytag: member="Wt::WSuggestionPopup::setDefaultIndex" ref="a9ebf63d4048a9662c3e05ae6be162993" args="(int row)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WSuggestionPopup::setDefaultIndex </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>row</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets a default selected value. </p>
<p><code>row</code> is the model row that is selected by default (only if it matches the current input).</p>
<p>The default value is -1, indicating no default. </p>

</div>
</div>
<a class="anchor" id="a8a77e3397fa98db0639fca3b1c94a8a2"></a><!-- doxytag: member="Wt::WSuggestionPopup::setFilterLength" ref="a8a77e3397fa98db0639fca3b1c94a8a2" args="(int count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WSuggestionPopup::setFilterLength </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>count</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the minimum input length before showing the popup. </p>
<p>When the user has typed this much characters, <a class="el" href="classWt_1_1WSuggestionPopup.html#a4c7f8529e7d49fca2a10e95bdbbd9815" title="Signal that indicates that the model should be filtered.">filterModel()</a> is emitted which allows you to filter the model based on the initial input.</p>
<p>The default value is 0, which has the effect of always showing the entire model.</p>
<p>A value of -1 indicates that server-side filtering is continuously applied, no matter the length of the text input.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WSuggestionPopup.html#a4c7f8529e7d49fca2a10e95bdbbd9815" title="Signal that indicates that the model should be filtered.">filterModel()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a20846bf7fb64c992a2f98904b482b1c4"></a><!-- doxytag: member="Wt::WSuggestionPopup::setGlobalPopup" ref="a20846bf7fb64c992a2f98904b482b1c4" args="(bool global)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WSuggestionPopup::setGlobalPopup </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>global</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Controls how the suggestion popup is positioned. </p>
<p>When <code>global</code> is <code>true</code>, then the popup will position itself globally. This avoids that the popup is affected by enclosing parents with overflow settings that clip the popup. This makes the popup however no longer follow the popup line edit when this line edit moves.</p>
<p>The default is <code>false</code>. </p>

</div>
</div>
<a class="anchor" id="abd7500d03679e0190307a753d78085ec"></a><!-- doxytag: member="Wt::WSuggestionPopup::setMaximumSize" ref="abd7500d03679e0190307a753d78085ec" args="(const WLength &amp;width, const WLength &amp;height)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WSuggestionPopup::setMaximumSize </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WLength.html">WLength</a> &amp;&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WLength.html">WLength</a> &amp;&#160;</td>
          <td class="paramname"><em>height</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets a maximum size. </p>
<p>Specifies a maximum size for this widget, setting CSS <code>max-width</code> and <code>max-height</code> properties.</p>
<p>The default the maximum width and height are <a class="el" href="classWt_1_1WLength.html#a0cf39ca4225776879d56ade60320c31a" title="An &#39;auto&#39; length.">WLength::Auto</a>, indicating no maximum size. A <a class="el" href="classWt_1_1WLength.html#a908caf5d6be7e244e24598e6d22cd4c0a304d9ef07db638690997830a7b348db1" title="Percentage (meaning context-sensitive)">WLength::Percentage</a> size should not be used, as this is (in virtually all cases) undefined behaviour.</p>
<p>When the widget is a container widget that contains a layout manager, then setting a maximum size will have the effect of letting the size of the container to reflect the preferred size of the contents (rather than constraining the size of the children based on the size of the container), up to the specified maximum size.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WCompositeWidget.html#a976e94e38c7a9cc0f212e13a9792912e" title="Resizes the widget.">resize()</a>, <a class="el" href="classWt_1_1WSuggestionPopup.html#a7db92809f8e5d3751d2a9bf446549497" title="Sets a minimum size.">setMinimumSize()</a> </dd></dl>

<p>Reimplemented from <a class="el" href="classWt_1_1WCompositeWidget.html#a7ba5622622b118e72b9a407d10df7ece">Wt::WCompositeWidget</a>.</p>

</div>
</div>
<a class="anchor" id="a7db92809f8e5d3751d2a9bf446549497"></a><!-- doxytag: member="Wt::WSuggestionPopup::setMinimumSize" ref="a7db92809f8e5d3751d2a9bf446549497" args="(const WLength &amp;width, const WLength &amp;height)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WSuggestionPopup::setMinimumSize </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WLength.html">WLength</a> &amp;&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WLength.html">WLength</a> &amp;&#160;</td>
          <td class="paramname"><em>height</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets a minimum size. </p>
<p>Specifies a minimum size for this widget, setting CSS <code>min-width</code> and <code>min-height</code> properties.</p>
<p>The default minimum width and height is 0. The special value <a class="el" href="classWt_1_1WLength.html#a0cf39ca4225776879d56ade60320c31a" title="An &#39;auto&#39; length.">WLength::Auto</a> indicates that the initial width is used as minimum size. A <a class="el" href="classWt_1_1WLength.html#a908caf5d6be7e244e24598e6d22cd4c0a304d9ef07db638690997830a7b348db1" title="Percentage (meaning context-sensitive)">WLength::Percentage</a> size should not be used, as this is (in virtually all cases) undefined behaviour.</p>
<p>When the widget is inserted in a layout manager, then the minimum size will be taken into account.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WCompositeWidget.html#a976e94e38c7a9cc0f212e13a9792912e" title="Resizes the widget.">resize()</a>, <a class="el" href="classWt_1_1WCompositeWidget.html#ab14d3fa5b63d36c1df1148f49b62e92a" title="Returns the minimum width.">minimumWidth()</a>, <a class="el" href="classWt_1_1WCompositeWidget.html#a3289852d4a8a268fc8ee2c4c474bce15" title="Returns the minimum height.">minimumHeight()</a> </dd></dl>

<p>Reimplemented from <a class="el" href="classWt_1_1WCompositeWidget.html#acf95c795e47eee85425c98509aa8e57a">Wt::WCompositeWidget</a>.</p>

</div>
</div>
<a class="anchor" id="a4b4e3dcc77433195c5439ab86ac5d95c"></a><!-- doxytag: member="Wt::WSuggestionPopup::setModel" ref="a4b4e3dcc77433195c5439ab86ac5d95c" args="(WAbstractItemModel *model)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WSuggestionPopup::setModel </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1WAbstractItemModel.html">WAbstractItemModel</a> *&#160;</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 suggestions. </p>
<p>The <code>model</code> may not be <code>0</code>, 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 suggestion popup.</p>
<p>The <a class="el" href="group__modelview.html#gga0ae864e12320f9f89172735e075ed068a5ed17aded8a0e3b712698cf85a218f1f" title="Role for textual representation.">Wt::DisplayRole</a> is used for the suggestion text. The <a class="el" href="group__modelview.html#gga0ae864e12320f9f89172735e075ed068a9b7eae9fc07ea4fd8afe7bc97954162c" title="First role reserved for user purposes.">Wt::UserRole</a> is used for the suggestion value, unless empty, in which case the suggestion text is used as value.</p>
<p>Note that since the default WStringListModel does not support UserRole data, you will want to change it to a more general model (e.g. <a class="el" href="classWt_1_1WStandardItemModel.html" title="A standard data model, which stores its data in memory.">WStandardItemModel</a>) if you want suggestion values that are different from display values.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WSuggestionPopup.html#a6616d230bad6511bc40d3bf2c1e4ec84" title="Sets the column in the model to be used for the items.">setModelColumn(int)</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a6616d230bad6511bc40d3bf2c1e4ec84"></a><!-- doxytag: member="Wt::WSuggestionPopup::setModelColumn" ref="a6616d230bad6511bc40d3bf2c1e4ec84" args="(int index)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WSuggestionPopup::setModelColumn </td>
          <td>(</td>
          <td class="paramtype">int&#160;</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_1WSuggestionPopup.html#a4b4e3dcc77433195c5439ab86ac5d95c" title="Sets the model to be used for the suggestions.">setModel()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a0dd2b20a4a1505d464a8213585bbc4d3"></a><!-- doxytag: member="Wt::WSuggestionPopup::showAt" ref="a0dd2b20a4a1505d464a8213585bbc4d3" args="(WFormWidget *edit)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WSuggestionPopup::showAt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1WFormWidget.html">WFormWidget</a> *&#160;</td>
          <td class="paramname"><em>edit</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Shows the suggestion popup at an edit field. </p>
<p>This is equivalent to the user triggering the suggestion popup to be shown. </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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</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&nbsp;<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>