File: TreeNode_8h-source.html

package info (click to toggle)
witty 3.1.2-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 45,512 kB
  • ctags: 35,832
  • sloc: cpp: 69,469; ansic: 66,945; xml: 4,383; sh: 594; perl: 108; makefile: 106
file content (98 lines) | stat: -rw-r--r-- 12,654 bytes parent folder | download
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Wt examples: /home/koen/project/wt/public-git/wt/examples/treelist/TreeNode.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;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>
<h1>/home/koen/project/wt/public-git/wt/examples/treelist/TreeNode.h</h1><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 &lt;Wt/WCompositeWidget&gt;</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;Wt/WText&gt;</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#43fc53dd07a7568cb153822c439c4c65">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#ed275ce59686bd08fdabaaea3488e4db" 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#140dea437d52d3d7c438ea3bd16a1480">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#3461e31818c4d2f516641bdaf508312a">parent</a> = 0);
<a name="l00071"></a>00071 
<a name="l00074"></a>00074   <span class="keywordtype">void</span> <a class="code" href="classTreeNode.html#a3bca1b27d9cbb05b0fa13504498179e" title="Add 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#a772a12f5220a2256247048a1edcc581" title="Remove 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#73afc6b5f7587505a5c1ba1cf2a51341">00082</a>   <span class="keyword">const</span> std::vector&lt;TreeNode *&gt;&amp; <a class="code" href="classTreeNode.html#73afc6b5f7587505a5c1ba1cf2a51341" title="Get the list of children.">childNodes</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTreeNode.html#34d25e9f0be4f1ed6535d3f47dbec443" title="List of child nodes.">childNodes_</a>; }
<a name="l00083"></a>00083 
<a name="l00084"></a>00084 <span class="keyword">public</span> slots:
<a name="l00087"></a>00087   <span class="keywordtype">void</span> <a class="code" href="classTreeNode.html#7c38a975e8b3a31932b8409fa4231bc4" title="Collapse this node.">collapse</a>();
<a name="l00088"></a>00088 
<a name="l00091"></a>00091   <span class="keywordtype">void</span> <a class="code" href="classTreeNode.html#bac0f39de477ab6f8d3373ae9f900652" title="Expand this node.">expand</a>();
<a name="l00092"></a>00092 
<a name="l00093"></a>00093 <span class="keyword">private</span>:
<a name="l00095"></a><a class="code" href="classTreeNode.html#34d25e9f0be4f1ed6535d3f47dbec443">00095</a>   std::vector&lt;TreeNode *&gt; <a class="code" href="classTreeNode.html#34d25e9f0be4f1ed6535d3f47dbec443" title="List of child nodes.">childNodes_</a>;
<a name="l00096"></a>00096 
<a name="l00098"></a><a class="code" href="classTreeNode.html#cbb1649a75a11ed3dee8022bfdf53b6c">00098</a>   <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a>                 *<a class="code" href="classTreeNode.html#cbb1649a75a11ed3dee8022bfdf53b6c" title="The parent node.">parentNode_</a>;
<a name="l00099"></a>00099 
<a name="l00101"></a><a class="code" href="classTreeNode.html#37660f20c29ac82614c35b41356e30e1">00101</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#37660f20c29ac82614c35b41356e30e1" title="Layout (2x2 table).">layout_</a>;
<a name="l00102"></a>00102 
<a name="l00104"></a><a class="code" href="classTreeNode.html#61266475f7f53fa8e43410f0fdb96fc0">00104</a>   <a class="code" href="classIconPair.html" title="An icon pair (identical to WIconPair).">IconPair</a>                 *<a class="code" href="classTreeNode.html#61266475f7f53fa8e43410f0fdb96fc0" title="The icon for expanding or collapsing.">expandIcon_</a>;
<a name="l00105"></a>00105 
<a name="l00107"></a><a class="code" href="classTreeNode.html#9eea36d4c2abeec8829cd6e94a0c8da2">00107</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#9eea36d4c2abeec8829cd6e94a0c8da2" title="The single image shown instead of the expand/collapse icon when no children.">noExpandIcon_</a>;
<a name="l00108"></a>00108 
<a name="l00110"></a><a class="code" href="classTreeNode.html#eb5228e3bfb5f8f210ef7ff62da5ec7f">00110</a>   <a class="code" href="classIconPair.html" title="An icon pair (identical to WIconPair).">IconPair</a>                 *<a class="code" href="classTreeNode.html#eb5228e3bfb5f8f210ef7ff62da5ec7f" title="The icon next to the label.">labelIcon_</a>;
<a name="l00111"></a>00111 
<a name="l00113"></a><a class="code" href="classTreeNode.html#9bd2202cc1f44ce4cf21943cc64e3bd2">00113</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#9bd2202cc1f44ce4cf21943cc64e3bd2" title="The label.">labelText_</a>;
<a name="l00114"></a>00114 
<a name="l00116"></a><a class="code" href="classTreeNode.html#6d5140f032f5b24b3398ccdcdba03ca0">00116</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#6d5140f032f5b24b3398ccdcdba03ca0" title="The children count &amp;#39;(x)&amp;#39; for x children.">childCountLabel_</a>;
<a name="l00117"></a>00117 
<a name="l00119"></a><a class="code" href="classTreeNode.html#1aef899199fbedac9990f7902fa7fc23">00119</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#1aef899199fbedac9990f7902fa7fc23" title="The container in which the children are managed.">expandedContent_</a>;
<a name="l00120"></a>00120 
<a name="l00122"></a>00122   <span class="keywordtype">void</span> <a class="code" href="classTreeNode.html#daba65c9268249f665d548082d94b930" title="Adjust the expand icon.">adjustExpandIcon</a>();
<a name="l00123"></a>00123 
<a name="l00125"></a>00125   <span class="keywordtype">bool</span> <a class="code" href="classTreeNode.html#bc3819da4ca51204db2f9528d0ea1c73" title="Returns if is the last child within its parent (is rendered differently).">isLastChildNode</a>() <span class="keyword">const</span>;
<a name="l00126"></a>00126 
<a name="l00128"></a>00128   <span class="keywordtype">void</span> <a class="code" href="classTreeNode.html#3e45cd3a50ee872dcff38b27c41b42fb" title="Rerender when children have changed.">childNodesChanged</a>();
<a name="l00129"></a>00129 
<a name="l00131"></a><a class="code" href="classTreeNode.html#650686b10a2f2cdb815462dbf030c204">00131</a>   <span class="keywordtype">bool</span> <a class="code" href="classTreeNode.html#650686b10a2f2cdb815462dbf030c204" title="Was collapsed (for undo of prelearned collapse() and expand() slots.">wasCollapsed_</a>;
<a name="l00132"></a>00132 
<a name="l00134"></a>00134   <span class="keywordtype">void</span> <a class="code" href="classTreeNode.html#0dadb29c855289ba6adaabed4ba86990" title="Undo function for prelearning collapse().">undoCollapse</a>();
<a name="l00135"></a>00135 
<a name="l00137"></a>00137   <span class="keywordtype">void</span> <a class="code" href="classTreeNode.html#353196fdcb63d58e6a1a007a81bb81ee" title="Undo function for prelearning expand().">undoExpand</a>();
<a name="l00138"></a>00138 
<a name="l00140"></a><a class="code" href="classTreeNode.html#8ec244c77c2d4cd7335340dead3ff6e5c16e3d1c45f2863648cd9332dc464ec7">00140</a>   <span class="keyword">enum</span> <a class="code" href="classTreeNode.html#8ec244c77c2d4cd7335340dead3ff6e5" title="Two sets of images, for a normal node, and for the last node.">ImageIndex</a> { <a class="code" href="classTreeNode.html#8ec244c77c2d4cd7335340dead3ff6e5c16e3d1c45f2863648cd9332dc464ec7">Middle</a> = 0, <a class="code" href="classTreeNode.html#8ec244c77c2d4cd7335340dead3ff6e5a9495647920a84019492819c907b9b0c">Last</a> = 1 };
<a name="l00141"></a>00141 
<a name="l00142"></a><a class="code" href="classTreeNode.html#55d4c04fb9c147448963b149e8fc8cb6">00142</a>   <span class="keyword">static</span> std::string <a class="code" href="classTreeNode.html#55d4c04fb9c147448963b149e8fc8cb6">imageLine_</a>[];
<a name="l00143"></a><a class="code" href="classTreeNode.html#75675ae3d29018b6bc5d3bb614ed494b">00143</a>   <span class="keyword">static</span> std::string <a class="code" href="classTreeNode.html#75675ae3d29018b6bc5d3bb614ed494b">imagePlus_</a>[];
<a name="l00144"></a><a class="code" href="classTreeNode.html#b404df187e81ce5f216eb815572f11b6">00144</a>   <span class="keyword">static</span> std::string <a class="code" href="classTreeNode.html#b404df187e81ce5f216eb815572f11b6">imageMin_</a>[];
<a name="l00145"></a>00145 }; <span class="comment">//</span>
<a name="l00146"></a>00146 
<a name="l00149"></a>00149 <span class="preprocessor">#endif // WTREENODE_H_</span>
</pre></div></div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:12 2010 for <a href="http://www.webtoolkit.eu/wt/">Wt</a> by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
</body>
</html>