Sophie

Sophie

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

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 examples: DemoTreeList Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</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 examples
   &#160;<span id="projectnumber">3.2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</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>
    </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>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a>  </div>
  <div class="headertitle">
<div class="title">DemoTreeList Class Reference<div class="ingroups"><a class="el" href="group__treelist.html">Treelist example</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="DemoTreeList" --><!-- doxytag: inherits="Wt::WContainerWidget" -->
<p>A demonstration of the treelist.  
 <a href="classDemoTreeList.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="DemoTreeList_8h_source.html">DemoTreeList.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for DemoTreeList:</div>
<div class="dyncontent">
<div class="center"><img src="classDemoTreeList__inherit__graph.png" border="0" usemap="#DemoTreeList_inherit__map" alt="Inheritance graph"/></div>
<map name="DemoTreeList_inherit__map" id="DemoTreeList_inherit__map">
<area shape="rect" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html" title="Wt::WContainerWidget" alt="" coords="5,304,160,331"/><area shape="rect" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WInteractWidget.html" title="Wt::WInteractWidget" alt="" coords="11,229,155,256"/><area shape="rect" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWebWidget.html" title="Wt::WWebWidget" alt="" coords="19,155,147,181"/><area shape="rect" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html" title="Wt::WWidget" alt="" coords="33,80,132,107"/><area shape="rect" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html" title="Wt::WObject" alt="" coords="35,5,131,32"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classDemoTreeList-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">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#a5b07059aecf22b392e2d055cf451b0c7">DemoTreeList</a> (<a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">Wt::WContainerWidget</a> *<a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#a3461e31818c4d2f516641bdaf508312a">parent</a>)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a <a class="el" href="classDemoTreeList.html" title="A demonstration of the treelist.">DemoTreeList</a>.  <a href="#a5b07059aecf22b392e2d055cf451b0c7"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#a59023d58bc5bb025d463935ed6f57b6b">addMap</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a map.  <a href="#a59023d58bc5bb025d463935ed6f57b6b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#a32e8d75762ff66fcab135cd55c6bcca6">removeMap</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove a map.  <a href="#a32e8d75762ff66fcab135cd55c6bcca6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTreeNode.html">TreeNode</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#ac1ddf9da261c37e9255eaa1fb972d6e2">makeTreeMap</a> (const std::string name, <a class="el" href="classTreeNode.html">TreeNode</a> *<a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#a3461e31818c4d2f516641bdaf508312a">parent</a>)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a "map" node, and insert in the given parent.  <a href="#ac1ddf9da261c37e9255eaa1fb972d6e2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTreeNode.html">TreeNode</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#aef0149499570b8b89cbabe75879e30b6">makeTreeFile</a> (const std::string name, <a class="el" href="classTreeNode.html">TreeNode</a> *<a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#a3461e31818c4d2f516641bdaf508312a">parent</a>)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a "file" node, and insert in the given parent.  <a href="#aef0149499570b8b89cbabe75879e30b6"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTreeNode.html">TreeNode</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#a5b3471e575b6bf0dfa9e19cc41510d7d">tree_</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTreeNode.html">TreeNode</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#af38b14ae38847b7f8c47d56fe5e89b34">testMap_</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#a297ac3606b05e9185efc802cf0ebbadd">testCount_</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WPushButton.html">Wt::WPushButton</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#a4f796ef14583c6b7fc0aec13508d83ee">addMapButton_</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WPushButton.html">Wt::WPushButton</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#aa77bb14d293f3efde79a47d3b4a5214e">removeMapButton_</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A demonstration of the treelist. </p>
<p>This is the main class for the treelist example. </p>

<p>Definition at line <a class="el" href="DemoTreeList_8h_source.html#l00027">27</a> of file <a class="el" href="DemoTreeList_8h_source.html">DemoTreeList.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a5b07059aecf22b392e2d055cf451b0c7"></a><!-- doxytag: member="DemoTreeList::DemoTreeList" ref="a5b07059aecf22b392e2d055cf451b0c7" args="(Wt::WContainerWidget *parent)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DemoTreeList::DemoTreeList </td>
          <td>(</td>
          <td class="paramtype"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">Wt::WContainerWidget</a> *&#160;</td>
          <td class="paramname"><em>parent</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create a <a class="el" href="classDemoTreeList.html" title="A demonstration of the treelist.">DemoTreeList</a>. </p>

<p>Definition at line <a class="el" href="DemoTreeList_8C_source.html#l00020">20</a> of file <a class="el" href="DemoTreeList_8C_source.html">DemoTreeList.C</a>.</p>
<div class="fragment"><pre class="fragment">  : <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html#a520ba6e52a36a7f2efbef1a31a69e898">WContainerWidget</a>(parent),
    <a class="code" href="classDemoTreeList.html#a297ac3606b05e9185efc802cf0ebbadd">testCount_</a>(0)
{
  <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html#a2cfe66d9b62940f889e99538a9f478d2">addWidget</a>
    (<span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WText.html">WText</a>(<span class="stringliteral">&quot;&lt;h2&gt;Wt Tree List example&lt;/h2&gt;&quot;</span>
               <span class="stringliteral">&quot;&lt;p&gt;This is a simple demo of a treelist, implemented using&quot;</span>
               <span class="stringliteral">&quot; &lt;a href=&#39;http://witty.sourceforge.net/&#39;&gt;Wt&lt;/a&gt;.&lt;/p&gt;&quot;</span>
               <span class="stringliteral">&quot;&lt;p&gt;The leafs of the tree contain the source code of the &quot;</span>
               <span class="stringliteral">&quot;tree-list in the classes &lt;b&gt;TreeNode&lt;/b&gt; and &quot;</span>
               <span class="stringliteral">&quot;&lt;b&gt;IconPair&lt;/b&gt;, as well as the implementation of this &quot;</span>
               <span class="stringliteral">&quot;demo itself in the class &lt;b&gt;DemoTreeList&lt;/b&gt;.&lt;/p&gt;&quot;</span>));

  <a class="code" href="classDemoTreeList.html#a5b3471e575b6bf0dfa9e19cc41510d7d">tree_</a> = <a class="code" href="classDemoTreeList.html#ac1ddf9da261c37e9255eaa1fb972d6e2" title="Create a &quot;map&quot; node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">&quot;Examples&quot;</span>, 0);
  <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html#a2cfe66d9b62940f889e99538a9f478d2">addWidget</a>(<a class="code" href="classDemoTreeList.html#a5b3471e575b6bf0dfa9e19cc41510d7d">tree_</a>);

  <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *treelist = <a class="code" href="classDemoTreeList.html#ac1ddf9da261c37e9255eaa1fb972d6e2" title="Create a &quot;map&quot; node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">&quot;Tree List&quot;</span>, <a class="code" href="classDemoTreeList.html#a5b3471e575b6bf0dfa9e19cc41510d7d">tree_</a>);
  <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *wstateicon = <a class="code" href="classDemoTreeList.html#ac1ddf9da261c37e9255eaa1fb972d6e2" title="Create a &quot;map&quot; node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">&quot;class IconPair&quot;</span>, treelist);
  <a class="code" href="classDemoTreeList.html#aef0149499570b8b89cbabe75879e30b6" title="Create a &quot;file&quot; node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">&quot;&lt;a href=\&quot;IconPair.h\&quot;&gt;IconPair.h&lt;/a&gt;&quot;</span>, wstateicon);
  <a class="code" href="classDemoTreeList.html#aef0149499570b8b89cbabe75879e30b6" title="Create a &quot;file&quot; node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">&quot;&lt;a href=\&quot;IconPair.C\&quot;&gt;IconPair.C&lt;/a&gt;&quot;</span>, wstateicon);
  <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *wtreenode = <a class="code" href="classDemoTreeList.html#ac1ddf9da261c37e9255eaa1fb972d6e2" title="Create a &quot;map&quot; node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">&quot;class TreeNode&quot;</span>, treelist);
  <a class="code" href="classDemoTreeList.html#aef0149499570b8b89cbabe75879e30b6" title="Create a &quot;file&quot; node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">&quot;&lt;a href=\&quot;TreeNode.h\&quot;&gt;TreeNode.h&lt;/a&gt;&quot;</span>, wtreenode);
  <a class="code" href="classDemoTreeList.html#aef0149499570b8b89cbabe75879e30b6" title="Create a &quot;file&quot; node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">&quot;&lt;a href=\&quot;TreeNode.C\&quot;&gt;TreeNode.C&lt;/a&gt;&quot;</span>, wtreenode);
  <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *demotreelist = <a class="code" href="classDemoTreeList.html#ac1ddf9da261c37e9255eaa1fb972d6e2" title="Create a &quot;map&quot; node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">&quot;class DemoTreeList&quot;</span>, treelist);
  <a class="code" href="classDemoTreeList.html#aef0149499570b8b89cbabe75879e30b6" title="Create a &quot;file&quot; node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">&quot;&lt;a href=\&quot;DemoTreeList.h\&quot;&gt;DemoTreeList.h&lt;/a&gt;&quot;</span>, demotreelist);
  <a class="code" href="classDemoTreeList.html#aef0149499570b8b89cbabe75879e30b6" title="Create a &quot;file&quot; node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">&quot;&lt;a href=\&quot;DemoTreeList.C\&quot;&gt;DemoTreeList.C&lt;/a&gt;&quot;</span>, demotreelist);

  <a class="code" href="classDemoTreeList.html#af38b14ae38847b7f8c47d56fe5e89b34">testMap_</a> = <a class="code" href="classDemoTreeList.html#ac1ddf9da261c37e9255eaa1fb972d6e2" title="Create a &quot;map&quot; node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">&quot;Test map&quot;</span>, <a class="code" href="classDemoTreeList.html#a5b3471e575b6bf0dfa9e19cc41510d7d">tree_</a>);

  <span class="comment">/*</span>
<span class="comment">   * Buttons to dynamically demonstrate changing the tree contents.</span>
<span class="comment">   */</span>
  <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html#a2cfe66d9b62940f889e99538a9f478d2">addWidget</a>
    (<span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WText.html">WText</a>(<span class="stringliteral">&quot;&lt;p&gt;Use the following buttons to change the tree &quot;</span>
               <span class="stringliteral">&quot;contents:&lt;/p&gt;&quot;</span>));

  <a class="code" href="classDemoTreeList.html#a4f796ef14583c6b7fc0aec13508d83ee">addMapButton_</a>
    = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WPushButton.html">WPushButton</a>(<span class="stringliteral">&quot;Add map&quot;</span>, <span class="keyword">this</span>);
  <a class="code" href="classDemoTreeList.html#a4f796ef14583c6b7fc0aec13508d83ee">addMapButton_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WInteractWidget.html#ae11e050cce0d4a8f742afa3ef92bfe8c">clicked</a>().connect(<span class="keyword">this</span>, &amp;<a class="code" href="classDemoTreeList.html#a59023d58bc5bb025d463935ed6f57b6b" title="Add a map.">DemoTreeList::addMap</a>);

  <a class="code" href="classDemoTreeList.html#aa77bb14d293f3efde79a47d3b4a5214e">removeMapButton_</a>
    = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WPushButton.html">WPushButton</a>(<span class="stringliteral">&quot;Remove map&quot;</span>, <span class="keyword">this</span>);
  <a class="code" href="classDemoTreeList.html#aa77bb14d293f3efde79a47d3b4a5214e">removeMapButton_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WInteractWidget.html#ae11e050cce0d4a8f742afa3ef92bfe8c">clicked</a>().connect(<span class="keyword">this</span>, &amp;<a class="code" href="classDemoTreeList.html#a32e8d75762ff66fcab135cd55c6bcca6" title="Remove a map.">DemoTreeList::removeMap</a>);
  <a class="code" href="classDemoTreeList.html#aa77bb14d293f3efde79a47d3b4a5214e">removeMapButton_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#a5f68ea0ab29adfb8e559153fca281e03">disable</a>();

  <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html#a2cfe66d9b62940f889e99538a9f478d2">addWidget</a>
    (<span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WText.html">WText</a>(<span class="stringliteral">&quot;&lt;p&gt;Remarks:&quot;</span>
               <span class="stringliteral">&quot;&lt;ul&gt;&quot;</span>
               <span class="stringliteral">&quot;&lt;li&gt;&lt;p&gt;This is not the instantiation of a pre-defined &quot;</span>
               <span class="stringliteral">&quot;tree list component, but the full implementation of such &quot;</span>
               <span class="stringliteral">&quot;a component, in about 350 lines of C++ code !&lt;/p&gt; &quot;</span>
               <span class="stringliteral">&quot;&lt;p&gt;In comparison, the &lt;a href=&#39;http://myfaces.apache.org&#39;&gt; &quot;</span>
               <span class="stringliteral">&quot;Apache MyFaces&lt;/a&gt; JSF implementation of tree2, with similar &quot;</span>
               <span class="stringliteral">&quot;functionality, uses about 2400 lines of Java, and 140 lines &quot;</span>
               <span class="stringliteral">&quot;of JavaScript code.&lt;/p&gt;&lt;/li&gt;&quot;</span>
               <span class="stringliteral">&quot;&lt;li&gt;&lt;p&gt;Once loaded, the tree list does not require any &quot;</span>
               <span class="stringliteral">&quot;interaction with the server for handling the click events on &quot;</span>
               <span class="stringliteral">&quot;the &lt;img src=&#39;icons/nav-plus-line-middle.gif&#39; /&gt; and &quot;</span>
               <span class="stringliteral">&quot;&lt;img src=&#39;icons/nav-minus-line-middle.gif&#39; /&gt; icons, &quot;</span>
               <span class="stringliteral">&quot;because these events have been connected to slots using &quot;</span>
               <span class="stringliteral">&quot;STATIC connections. Such connections are converted to the &quot;</span>
               <span class="stringliteral">&quot;appropriate JavaScript code that is inserted into the page. &quot;</span>
               <span class="stringliteral">&quot;Still, the events are signaled to the server to update the &quot;</span>
               <span class="stringliteral">&quot;application state.&lt;/p&gt;&lt;/li&gt;&quot;</span>
               <span class="stringliteral">&quot;&lt;li&gt;&lt;p&gt;In contrast, the buttons for manipulating the tree &quot;</span>
               <span class="stringliteral">&quot;contents use DYNAMIC connections, and thus the update &quot;</span>
               <span class="stringliteral">&quot;is computed at server-side, and communicated back to the &quot;</span>
               <span class="stringliteral">&quot;browser (by default using AJAX).&lt;/p&gt;&lt;/li&gt;&quot;</span>
               <span class="stringliteral">&quot;&lt;li&gt;&lt;p&gt;When loading a page, only visible widgets (that are not &quot;</span>
               <span class="stringliteral">&quot;&lt;b&gt;setHidden(true)&lt;/b&gt;) are transmitted. &quot;</span>
               <span class="stringliteral">&quot;The remaining widgets are loaded in the background after &quot;</span>
               <span class="stringliteral">&quot;rendering the page. &quot;</span>
               <span class="stringliteral">&quot;As a result the application is loaded as fast as possible.&lt;/p&gt;&quot;</span>
               <span class="stringliteral">&quot;&lt;/li&gt;&quot;</span>
               <span class="stringliteral">&quot;&lt;li&gt;&lt;p&gt;The browser reload button is supported and behaves as &quot;</span>
               <span class="stringliteral">&quot;expected: the page is reloaded from the server. Again, &quot;</span>
               <span class="stringliteral">&quot;only visible widgets are transmitted immediately.&lt;/p&gt; &quot;</span>
               <span class="stringliteral">&quot;&lt;p&gt;(For the curious, this is the way to see the actual &quot;</span>
               <span class="stringliteral">&quot;HTML/JavaScript code !)&lt;/p&gt;&lt;/li&gt;&quot;</span>
               <span class="stringliteral">&quot;&lt;/ul&gt;&lt;/p&gt;&quot;</span>));
}
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a59023d58bc5bb025d463935ed6f57b6b"></a><!-- doxytag: member="DemoTreeList::addMap" ref="a59023d58bc5bb025d463935ed6f57b6b" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void DemoTreeList::addMap </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Add a map. </p>

<p>Definition at line <a class="el" href="DemoTreeList_8C_source.html#l00102">102</a> of file <a class="el" href="DemoTreeList_8C_source.html">DemoTreeList.C</a>.</p>
<div class="fragment"><pre class="fragment">{
  <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *node
    = <a class="code" href="classDemoTreeList.html#ac1ddf9da261c37e9255eaa1fb972d6e2" title="Create a &quot;map&quot; node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">&quot;Map &quot;</span> + boost::lexical_cast&lt;std::string&gt;(++<a class="code" href="classDemoTreeList.html#a297ac3606b05e9185efc802cf0ebbadd">testCount_</a>),
                  <a class="code" href="classDemoTreeList.html#af38b14ae38847b7f8c47d56fe5e89b34">testMap_</a>);
  <a class="code" href="classDemoTreeList.html#aef0149499570b8b89cbabe75879e30b6" title="Create a &quot;file&quot; node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">&quot;File &quot;</span> + boost::lexical_cast&lt;std::string&gt;(<a class="code" href="classDemoTreeList.html#a297ac3606b05e9185efc802cf0ebbadd">testCount_</a>),
               node);

  <a class="code" href="classDemoTreeList.html#aa77bb14d293f3efde79a47d3b4a5214e">removeMapButton_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#ae6935d8baca9d37dd1d080b4383da87c">enable</a>();
}
</pre></div>
</div>
</div>
<a class="anchor" id="aef0149499570b8b89cbabe75879e30b6"></a><!-- doxytag: member="DemoTreeList::makeTreeFile" ref="aef0149499570b8b89cbabe75879e30b6" args="(const std::string name, TreeNode *parent)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classTreeNode.html">TreeNode</a> * DemoTreeList::makeTreeFile </td>
          <td>(</td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classTreeNode.html">TreeNode</a> *&#160;</td>
          <td class="paramname"><em>parent</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create a "file" node, and insert in the given parent. </p>

<p>Definition at line <a class="el" href="DemoTreeList_8C_source.html#l00143">143</a> of file <a class="el" href="DemoTreeList_8C_source.html">DemoTreeList.C</a>.</p>
<div class="fragment"><pre class="fragment">{
  <a class="code" href="classIconPair.html" title="An icon pair (identical to WIconPair)">IconPair</a> *labelIcon
    = <span class="keyword">new</span> <a class="code" href="classIconPair.html" title="An icon pair (identical to WIconPair)">IconPair</a>(<span class="stringliteral">&quot;icons/document.png&quot;</span>, <span class="stringliteral">&quot;icons/yellow-folder-open.png&quot;</span>,
                   <span class="keyword">false</span>);

  <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *node = <span class="keyword">new</span> <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a>(name, XHTMLText, labelIcon, 0);
  <span class="keywordflow">if</span> (parent)
    parent-&gt;<a class="code" href="classTreeNode.html#aa3bca1b27d9cbb05b0fa13504498179e" title="Adds a child node.">addChildNode</a>(node);

  <span class="keywordflow">return</span> node;
}
</pre></div>
</div>
</div>
<a class="anchor" id="ac1ddf9da261c37e9255eaa1fb972d6e2"></a><!-- doxytag: member="DemoTreeList::makeTreeMap" ref="ac1ddf9da261c37e9255eaa1fb972d6e2" args="(const std::string name, TreeNode *parent)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classTreeNode.html">TreeNode</a> * DemoTreeList::makeTreeMap </td>
          <td>(</td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classTreeNode.html">TreeNode</a> *&#160;</td>
          <td class="paramname"><em>parent</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create a "map" node, and insert in the given parent. </p>

<p>Definition at line <a class="el" href="DemoTreeList_8C_source.html#l00129">129</a> of file <a class="el" href="DemoTreeList_8C_source.html">DemoTreeList.C</a>.</p>
<div class="fragment"><pre class="fragment">{
  <a class="code" href="classIconPair.html" title="An icon pair (identical to WIconPair)">IconPair</a> *labelIcon
    = <span class="keyword">new</span> <a class="code" href="classIconPair.html" title="An icon pair (identical to WIconPair)">IconPair</a>(<span class="stringliteral">&quot;icons/yellow-folder-closed.png&quot;</span>,
                   <span class="stringliteral">&quot;icons/yellow-folder-open.png&quot;</span>,
                   <span class="keyword">false</span>);

  <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *node = <span class="keyword">new</span> <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a>(name, PlainText, labelIcon, 0);
  <span class="keywordflow">if</span> (parent)
    parent-&gt;<a class="code" href="classTreeNode.html#aa3bca1b27d9cbb05b0fa13504498179e" title="Adds a child node.">addChildNode</a>(node);

  <span class="keywordflow">return</span> node;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a32e8d75762ff66fcab135cd55c6bcca6"></a><!-- doxytag: member="DemoTreeList::removeMap" ref="a32e8d75762ff66fcab135cd55c6bcca6" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void DemoTreeList::removeMap </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Remove a map. </p>

<p>Definition at line <a class="el" href="DemoTreeList_8C_source.html#l00113">113</a> of file <a class="el" href="DemoTreeList_8C_source.html">DemoTreeList.C</a>.</p>
<div class="fragment"><pre class="fragment">{
  <span class="keywordtype">int</span> numMaps = <a class="code" href="classDemoTreeList.html#af38b14ae38847b7f8c47d56fe5e89b34">testMap_</a>-&gt;<a class="code" href="classTreeNode.html#a73afc6b5f7587505a5c1ba1cf2a51341" title="Returns the list of children.">childNodes</a>().size();

  <span class="keywordflow">if</span> (numMaps &gt; 0) {
    <span class="keywordtype">int</span> c = rand() % numMaps;

    <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *child = <a class="code" href="classDemoTreeList.html#af38b14ae38847b7f8c47d56fe5e89b34">testMap_</a>-&gt;<a class="code" href="classTreeNode.html#a73afc6b5f7587505a5c1ba1cf2a51341" title="Returns the list of children.">childNodes</a>()[c];
    <a class="code" href="classDemoTreeList.html#af38b14ae38847b7f8c47d56fe5e89b34">testMap_</a>-&gt;<a class="code" href="classTreeNode.html#aa772a12f5220a2256247048a1edcc581" title="Removes a child node.">removeChildNode</a>(child);
    <span class="keyword">delete</span> child;

    <span class="keywordflow">if</span> (numMaps == 1)
      <a class="code" href="classDemoTreeList.html#aa77bb14d293f3efde79a47d3b4a5214e">removeMapButton_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#a5f68ea0ab29adfb8e559153fca281e03">disable</a>();
  }
}
</pre></div>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a4f796ef14583c6b7fc0aec13508d83ee"></a><!-- doxytag: member="DemoTreeList::addMapButton_" ref="a4f796ef14583c6b7fc0aec13508d83ee" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WPushButton.html">Wt::WPushButton</a>* <a class="el" href="classDemoTreeList.html#a4f796ef14583c6b7fc0aec13508d83ee">DemoTreeList::addMapButton_</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="DemoTreeList_8h_source.html#l00039">39</a> of file <a class="el" href="DemoTreeList_8h_source.html">DemoTreeList.h</a>.</p>

</div>
</div>
<a class="anchor" id="aa77bb14d293f3efde79a47d3b4a5214e"></a><!-- doxytag: member="DemoTreeList::removeMapButton_" ref="aa77bb14d293f3efde79a47d3b4a5214e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WPushButton.html">Wt::WPushButton</a>* <a class="el" href="classDemoTreeList.html#aa77bb14d293f3efde79a47d3b4a5214e">DemoTreeList::removeMapButton_</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="DemoTreeList_8h_source.html#l00040">40</a> of file <a class="el" href="DemoTreeList_8h_source.html">DemoTreeList.h</a>.</p>

</div>
</div>
<a class="anchor" id="a297ac3606b05e9185efc802cf0ebbadd"></a><!-- doxytag: member="DemoTreeList::testCount_" ref="a297ac3606b05e9185efc802cf0ebbadd" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classDemoTreeList.html#a297ac3606b05e9185efc802cf0ebbadd">DemoTreeList::testCount_</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="DemoTreeList_8h_source.html#l00037">37</a> of file <a class="el" href="DemoTreeList_8h_source.html">DemoTreeList.h</a>.</p>

</div>
</div>
<a class="anchor" id="af38b14ae38847b7f8c47d56fe5e89b34"></a><!-- doxytag: member="DemoTreeList::testMap_" ref="af38b14ae38847b7f8c47d56fe5e89b34" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classTreeNode.html">TreeNode</a>* <a class="el" href="classDemoTreeList.html#af38b14ae38847b7f8c47d56fe5e89b34">DemoTreeList::testMap_</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="DemoTreeList_8h_source.html#l00036">36</a> of file <a class="el" href="DemoTreeList_8h_source.html">DemoTreeList.h</a>.</p>

</div>
</div>
<a class="anchor" id="a5b3471e575b6bf0dfa9e19cc41510d7d"></a><!-- doxytag: member="DemoTreeList::tree_" ref="a5b3471e575b6bf0dfa9e19cc41510d7d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classTreeNode.html">TreeNode</a>* <a class="el" href="classDemoTreeList.html#a5b3471e575b6bf0dfa9e19cc41510d7d">DemoTreeList::tree_</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="DemoTreeList_8h_source.html#l00035">35</a> of file <a class="el" href="DemoTreeList_8h_source.html">DemoTreeList.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/home/koen/project/wt/public-git/wt/examples/treelist/<a class="el" href="DemoTreeList_8h_source.html">DemoTreeList.h</a></li>
<li>/home/koen/project/wt/public-git/wt/examples/treelist/<a class="el" href="DemoTreeList_8C_source.html">DemoTreeList.C</a></li>
</ul>
</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>