1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
|
<!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: /home/koen/project/wt/public-git/wt/examples/treelist/TreeNode.h Source File</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.1</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><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>File Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">/home/koen/project/wt/public-git/wt/examples/treelist/TreeNode.h</div> </div>
</div>
<div class="contents">
<a href="TreeNode_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// This may look like C code, but it's really -*- C++ -*-</span>
<a name="l00002"></a>00002 <span class="comment">/*</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * See the LICENSE file for terms of use.</span>
<a name="l00006"></a>00006 <span class="comment"> */</span>
<a name="l00007"></a>00007 <span class="preprocessor">#ifndef TREENODE_H_</span>
<a name="l00008"></a>00008 <span class="preprocessor"></span><span class="preprocessor">#define TREENODE_H_</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span>
<a name="l00010"></a>00010 <span class="preprocessor">#include <Wt/WCompositeWidget></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include <Wt/WText></span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="keyword">class </span><a class="code" href="classIconPair.html" title="An icon pair (identical to WIconPair)">IconPair</a>;
<a name="l00014"></a>00014
<a name="l00015"></a>00015 <span class="keyword">namespace </span>Wt {
<a name="l00016"></a>00016 <span class="keyword">class </span>WTable;
<a name="l00017"></a>00017 <span class="keyword">class </span>WImage;
<a name="l00018"></a>00018 }
<a name="l00019"></a>00019
<a name="l00024"></a>00024
<a name="l00055"></a><a class="code" href="classTreeNode.html">00055</a> <span class="keyword">class </span><a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> : <span class="keyword">public</span> Wt::<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WCompositeWidget.html#a43fc53dd07a7568cb153822c439c4c65">WCompositeWidget</a>
<a name="l00056"></a>00056 {
<a name="l00057"></a>00057 <span class="keyword">public</span>:
<a name="l00068"></a>00068 <a class="code" href="classTreeNode.html#aed275ce59686bd08fdabaaea3488e4db" title="Construct a tree node with the given label.">TreeNode</a>(<span class="keyword">const</span> std::string labelText,
<a name="l00069"></a>00069 <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/namespaceWt.html#a140dea437d52d3d7c438ea3bd16a1480">Wt::TextFormat</a> labelFormat,
<a name="l00070"></a>00070 <a class="code" href="classIconPair.html" title="An icon pair (identical to WIconPair)">IconPair</a> *labelIcon, <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">Wt::WContainerWidget</a> *<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#a3461e31818c4d2f516641bdaf508312a">parent</a> = 0);
<a name="l00071"></a>00071
<a name="l00074"></a>00074 <span class="keywordtype">void</span> <a class="code" href="classTreeNode.html#aa3bca1b27d9cbb05b0fa13504498179e" title="Adds a child node.">addChildNode</a>(<a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *node);
<a name="l00075"></a>00075
<a name="l00078"></a>00078 <span class="keywordtype">void</span> <a class="code" href="classTreeNode.html#aa772a12f5220a2256247048a1edcc581" title="Removes a child node.">removeChildNode</a>(<a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *node);
<a name="l00079"></a>00079
<a name="l00082"></a><a class="code" href="classTreeNode.html#a73afc6b5f7587505a5c1ba1cf2a51341">00082</a> <span class="keyword">const</span> std::vector<TreeNode *>& <a class="code" href="classTreeNode.html#a73afc6b5f7587505a5c1ba1cf2a51341" title="Returns the list of children.">childNodes</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTreeNode.html#a34d25e9f0be4f1ed6535d3f47dbec443" title="List of child nodes.">childNodes_</a>; }
<a name="l00083"></a>00083
<a name="l00086"></a>00086 <span class="keywordtype">void</span> <a class="code" href="classTreeNode.html#a7c38a975e8b3a31932b8409fa4231bc4" title="Collapses this node.">collapse</a>();
<a name="l00087"></a>00087
<a name="l00090"></a>00090 <span class="keywordtype">void</span> <a class="code" href="classTreeNode.html#abac0f39de477ab6f8d3373ae9f900652" title="Expands this node.">expand</a>();
<a name="l00091"></a>00091
<a name="l00092"></a>00092 <span class="keyword">private</span>:
<a name="l00094"></a><a class="code" href="classTreeNode.html#a34d25e9f0be4f1ed6535d3f47dbec443">00094</a> std::vector<TreeNode *> <a class="code" href="classTreeNode.html#a34d25e9f0be4f1ed6535d3f47dbec443" title="List of child nodes.">childNodes_</a>;
<a name="l00095"></a>00095
<a name="l00097"></a><a class="code" href="classTreeNode.html#acbb1649a75a11ed3dee8022bfdf53b6c">00097</a> <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *<a class="code" href="classTreeNode.html#acbb1649a75a11ed3dee8022bfdf53b6c" title="The parent node.">parentNode_</a>;
<a name="l00098"></a>00098
<a name="l00100"></a><a class="code" href="classTreeNode.html#a37660f20c29ac82614c35b41356e30e1">00100</a> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WTable.html">Wt::WTable</a> *<a class="code" href="classTreeNode.html#a37660f20c29ac82614c35b41356e30e1" title="Layout (2x2 table).">layout_</a>;
<a name="l00101"></a>00101
<a name="l00103"></a><a class="code" href="classTreeNode.html#a61266475f7f53fa8e43410f0fdb96fc0">00103</a> <a class="code" href="classIconPair.html" title="An icon pair (identical to WIconPair)">IconPair</a> *<a class="code" href="classTreeNode.html#a61266475f7f53fa8e43410f0fdb96fc0" title="The icon for expanding or collapsing.">expandIcon_</a>;
<a name="l00104"></a>00104
<a name="l00106"></a><a class="code" href="classTreeNode.html#a9eea36d4c2abeec8829cd6e94a0c8da2">00106</a> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WImage.html">Wt::WImage</a> *<a class="code" href="classTreeNode.html#a9eea36d4c2abeec8829cd6e94a0c8da2" title="The single image shown instead of the expand/collapse icon when no children.">noExpandIcon_</a>;
<a name="l00107"></a>00107
<a name="l00109"></a><a class="code" href="classTreeNode.html#aeb5228e3bfb5f8f210ef7ff62da5ec7f">00109</a> <a class="code" href="classIconPair.html" title="An icon pair (identical to WIconPair)">IconPair</a> *<a class="code" href="classTreeNode.html#aeb5228e3bfb5f8f210ef7ff62da5ec7f" title="The icon next to the label.">labelIcon_</a>;
<a name="l00110"></a>00110
<a name="l00112"></a><a class="code" href="classTreeNode.html#a9bd2202cc1f44ce4cf21943cc64e3bd2">00112</a> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WText.html">Wt::WText</a> *<a class="code" href="classTreeNode.html#a9bd2202cc1f44ce4cf21943cc64e3bd2" title="The label.">labelText_</a>;
<a name="l00113"></a>00113
<a name="l00115"></a><a class="code" href="classTreeNode.html#a6d5140f032f5b24b3398ccdcdba03ca0">00115</a> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WText.html">Wt::WText</a> *<a class="code" href="classTreeNode.html#a6d5140f032f5b24b3398ccdcdba03ca0" title="The children count '(x)' for x children.">childCountLabel_</a>;
<a name="l00116"></a>00116
<a name="l00118"></a><a class="code" href="classTreeNode.html#a1aef899199fbedac9990f7902fa7fc23">00118</a> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">Wt::WContainerWidget</a> *<a class="code" href="classTreeNode.html#a1aef899199fbedac9990f7902fa7fc23" title="The container in which the children are managed.">expandedContent_</a>;
<a name="l00119"></a>00119
<a name="l00121"></a>00121 <span class="keywordtype">void</span> <a class="code" href="classTreeNode.html#adaba65c9268249f665d548082d94b930" title="Adjust the expand icon.">adjustExpandIcon</a>();
<a name="l00122"></a>00122
<a name="l00124"></a>00124 <span class="keywordtype">bool</span> <a class="code" href="classTreeNode.html#abc3819da4ca51204db2f9528d0ea1c73" title="Returns if is the last child within its parent (is rendered differently)">isLastChildNode</a>() <span class="keyword">const</span>;
<a name="l00125"></a>00125
<a name="l00127"></a>00127 <span class="keywordtype">void</span> <a class="code" href="classTreeNode.html#a3e45cd3a50ee872dcff38b27c41b42fb" title="Rerender when children have changed.">childNodesChanged</a>();
<a name="l00128"></a>00128
<a name="l00130"></a><a class="code" href="classTreeNode.html#a650686b10a2f2cdb815462dbf030c204">00130</a> <span class="keywordtype">bool</span> <a class="code" href="classTreeNode.html#a650686b10a2f2cdb815462dbf030c204" title="Was collapsed (for undo of prelearned collapse() and expand() slots.">wasCollapsed_</a>;
<a name="l00131"></a>00131
<a name="l00133"></a>00133 <span class="keywordtype">void</span> <a class="code" href="classTreeNode.html#a0dadb29c855289ba6adaabed4ba86990" title="Undo function for prelearning collapse()">undoCollapse</a>();
<a name="l00134"></a>00134
<a name="l00136"></a>00136 <span class="keywordtype">void</span> <a class="code" href="classTreeNode.html#a353196fdcb63d58e6a1a007a81bb81ee" title="Undo function for prelearning expand()">undoExpand</a>();
<a name="l00137"></a>00137
<a name="l00139"></a><a class="code" href="classTreeNode.html#a8ec244c77c2d4cd7335340dead3ff6e5ac16e3d1c45f2863648cd9332dc464ec7">00139</a> <span class="keyword">enum</span> <a class="code" href="classTreeNode.html#a8ec244c77c2d4cd7335340dead3ff6e5" title="Two sets of images, for a normal node, and for the last node.">ImageIndex</a> { <a class="code" href="classTreeNode.html#a8ec244c77c2d4cd7335340dead3ff6e5ac16e3d1c45f2863648cd9332dc464ec7">Middle</a> = 0, <a class="code" href="classTreeNode.html#a8ec244c77c2d4cd7335340dead3ff6e5aa9495647920a84019492819c907b9b0c">Last</a> = 1 };
<a name="l00140"></a>00140
<a name="l00141"></a><a class="code" href="classTreeNode.html#a55d4c04fb9c147448963b149e8fc8cb6">00141</a> <span class="keyword">static</span> std::string <a class="code" href="classTreeNode.html#a55d4c04fb9c147448963b149e8fc8cb6">imageLine_</a>[];
<a name="l00142"></a><a class="code" href="classTreeNode.html#a75675ae3d29018b6bc5d3bb614ed494b">00142</a> <span class="keyword">static</span> std::string <a class="code" href="classTreeNode.html#a75675ae3d29018b6bc5d3bb614ed494b">imagePlus_</a>[];
<a name="l00143"></a><a class="code" href="classTreeNode.html#ab404df187e81ce5f216eb815572f11b6">00143</a> <span class="keyword">static</span> std::string <a class="code" href="classTreeNode.html#ab404df187e81ce5f216eb815572f11b6">imageMin_</a>[];
<a name="l00144"></a>00144 }; <span class="comment">//</span>
<a name="l00145"></a>00145
<a name="l00148"></a>00148 <span class="preprocessor">#endif // WTREENODE_H_</span>
</pre></div></div>
</div>
<hr size="1"><address style="text-align: right; margin: 3px"><small>
Generated on Fri Mar 30 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>
|