<!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  <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 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 List</span></a></li> <li><a href="inherits.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pri-methods">Private Member Functions</a> | <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 <<a class="el" href="DemoTreeList_8h_source.html">DemoTreeList.h</a>></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"> </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"> </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 </td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#a59023d58bc5bb025d463935ed6f57b6b">addMap</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Add a map. <a href="#a59023d58bc5bb025d463935ed6f57b6b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#a32e8d75762ff66fcab135cd55c6bcca6">removeMap</a> ()</td></tr> <tr><td class="mdescLeft"> </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> * </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"> </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> * </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"> </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> * </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> * </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 </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> * </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> * </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 & 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> * </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">"<h2>Wt Tree List example</h2>"</span> <span class="stringliteral">"<p>This is a simple demo of a treelist, implemented using"</span> <span class="stringliteral">" <a href='http://witty.sourceforge.net/'>Wt</a>.</p>"</span> <span class="stringliteral">"<p>The leafs of the tree contain the source code of the "</span> <span class="stringliteral">"tree-list in the classes <b>TreeNode</b> and "</span> <span class="stringliteral">"<b>IconPair</b>, as well as the implementation of this "</span> <span class="stringliteral">"demo itself in the class <b>DemoTreeList</b>.</p>"</span>)); <a class="code" href="classDemoTreeList.html#a5b3471e575b6bf0dfa9e19cc41510d7d">tree_</a> = <a class="code" href="classDemoTreeList.html#ac1ddf9da261c37e9255eaa1fb972d6e2" title="Create a "map" node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">"Examples"</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 "map" node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">"Tree List"</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 "map" node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">"class IconPair"</span>, treelist); <a class="code" href="classDemoTreeList.html#aef0149499570b8b89cbabe75879e30b6" title="Create a "file" node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">"<a href=\"IconPair.h\">IconPair.h</a>"</span>, wstateicon); <a class="code" href="classDemoTreeList.html#aef0149499570b8b89cbabe75879e30b6" title="Create a "file" node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">"<a href=\"IconPair.C\">IconPair.C</a>"</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 "map" node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">"class TreeNode"</span>, treelist); <a class="code" href="classDemoTreeList.html#aef0149499570b8b89cbabe75879e30b6" title="Create a "file" node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">"<a href=\"TreeNode.h\">TreeNode.h</a>"</span>, wtreenode); <a class="code" href="classDemoTreeList.html#aef0149499570b8b89cbabe75879e30b6" title="Create a "file" node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">"<a href=\"TreeNode.C\">TreeNode.C</a>"</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 "map" node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">"class DemoTreeList"</span>, treelist); <a class="code" href="classDemoTreeList.html#aef0149499570b8b89cbabe75879e30b6" title="Create a "file" node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">"<a href=\"DemoTreeList.h\">DemoTreeList.h</a>"</span>, demotreelist); <a class="code" href="classDemoTreeList.html#aef0149499570b8b89cbabe75879e30b6" title="Create a "file" node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">"<a href=\"DemoTreeList.C\">DemoTreeList.C</a>"</span>, demotreelist); <a class="code" href="classDemoTreeList.html#af38b14ae38847b7f8c47d56fe5e89b34">testMap_</a> = <a class="code" href="classDemoTreeList.html#ac1ddf9da261c37e9255eaa1fb972d6e2" title="Create a "map" node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">"Test map"</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">"<p>Use the following buttons to change the tree "</span> <span class="stringliteral">"contents:</p>"</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">"Add map"</span>, <span class="keyword">this</span>); <a class="code" href="classDemoTreeList.html#a4f796ef14583c6b7fc0aec13508d83ee">addMapButton_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WInteractWidget.html#ae11e050cce0d4a8f742afa3ef92bfe8c">clicked</a>().connect(<span class="keyword">this</span>, &<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">"Remove map"</span>, <span class="keyword">this</span>); <a class="code" href="classDemoTreeList.html#aa77bb14d293f3efde79a47d3b4a5214e">removeMapButton_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WInteractWidget.html#ae11e050cce0d4a8f742afa3ef92bfe8c">clicked</a>().connect(<span class="keyword">this</span>, &<a class="code" href="classDemoTreeList.html#a32e8d75762ff66fcab135cd55c6bcca6" title="Remove a map.">DemoTreeList::removeMap</a>); <a class="code" href="classDemoTreeList.html#aa77bb14d293f3efde79a47d3b4a5214e">removeMapButton_</a>-><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">"<p>Remarks:"</span> <span class="stringliteral">"<ul>"</span> <span class="stringliteral">"<li><p>This is not the instantiation of a pre-defined "</span> <span class="stringliteral">"tree list component, but the full implementation of such "</span> <span class="stringliteral">"a component, in about 350 lines of C++ code !</p> "</span> <span class="stringliteral">"<p>In comparison, the <a href='http://myfaces.apache.org'> "</span> <span class="stringliteral">"Apache MyFaces</a> JSF implementation of tree2, with similar "</span> <span class="stringliteral">"functionality, uses about 2400 lines of Java, and 140 lines "</span> <span class="stringliteral">"of JavaScript code.</p></li>"</span> <span class="stringliteral">"<li><p>Once loaded, the tree list does not require any "</span> <span class="stringliteral">"interaction with the server for handling the click events on "</span> <span class="stringliteral">"the <img src='icons/nav-plus-line-middle.gif' /> and "</span> <span class="stringliteral">"<img src='icons/nav-minus-line-middle.gif' /> icons, "</span> <span class="stringliteral">"because these events have been connected to slots using "</span> <span class="stringliteral">"STATIC connections. Such connections are converted to the "</span> <span class="stringliteral">"appropriate JavaScript code that is inserted into the page. "</span> <span class="stringliteral">"Still, the events are signaled to the server to update the "</span> <span class="stringliteral">"application state.</p></li>"</span> <span class="stringliteral">"<li><p>In contrast, the buttons for manipulating the tree "</span> <span class="stringliteral">"contents use DYNAMIC connections, and thus the update "</span> <span class="stringliteral">"is computed at server-side, and communicated back to the "</span> <span class="stringliteral">"browser (by default using AJAX).</p></li>"</span> <span class="stringliteral">"<li><p>When loading a page, only visible widgets (that are not "</span> <span class="stringliteral">"<b>setHidden(true)</b>) are transmitted. "</span> <span class="stringliteral">"The remaining widgets are loaded in the background after "</span> <span class="stringliteral">"rendering the page. "</span> <span class="stringliteral">"As a result the application is loaded as fast as possible.</p>"</span> <span class="stringliteral">"</li>"</span> <span class="stringliteral">"<li><p>The browser reload button is supported and behaves as "</span> <span class="stringliteral">"expected: the page is reloaded from the server. Again, "</span> <span class="stringliteral">"only visible widgets are transmitted immediately.</p> "</span> <span class="stringliteral">"<p>(For the curious, this is the way to see the actual "</span> <span class="stringliteral">"HTML/JavaScript code !)</p></li>"</span> <span class="stringliteral">"</ul></p>"</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 "map" node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">"Map "</span> + boost::lexical_cast<std::string>(++<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 "file" node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">"File "</span> + boost::lexical_cast<std::string>(<a class="code" href="classDemoTreeList.html#a297ac3606b05e9185efc802cf0ebbadd">testCount_</a>), node); <a class="code" href="classDemoTreeList.html#aa77bb14d293f3efde79a47d3b4a5214e">removeMapButton_</a>-><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 </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> * </td> <td class="paramname"><em>parent</em> </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">"icons/document.png"</span>, <span class="stringliteral">"icons/yellow-folder-open.png"</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-><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 </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> * </td> <td class="paramname"><em>parent</em> </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">"icons/yellow-folder-closed.png"</span>, <span class="stringliteral">"icons/yellow-folder-open.png"</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-><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>-><a class="code" href="classTreeNode.html#a73afc6b5f7587505a5c1ba1cf2a51341" title="Returns the list of children.">childNodes</a>().size(); <span class="keywordflow">if</span> (numMaps > 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>-><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>-><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>-><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 <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>