File: classDemoTreeList.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 (446 lines) | stat: -rw-r--r-- 37,561 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
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
<!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: DemoTreeList Class Reference</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 class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>DemoTreeList Class Reference<br>
<small>
[<a class="el" href="group__treelist.html">Treelist example</a>]</small>
</h1><!-- doxytag: class="DemoTreeList" --><!-- doxytag: inherits="Wt::WContainerWidget" -->A demonstration of the treelist.  
<a href="#_details">More...</a>
<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="dynsection">
<p><center><img src="classDemoTreeList__inherit__graph.png" border="0" usemap="#DemoTreeList__inherit__map" alt="Inheritance graph"></center>
<map name="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,157,331"><area shape="rect" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WInteractWidget.html" title="Wt::WInteractWidget" alt="" coords="11,229,152,256"><area shape="rect" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html" title="Wt::WWebWidget" alt="" coords="20,155,143,181"><area shape="rect" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html" title="Wt::WWidget" alt="" coords="33,80,129,107"><area shape="rect" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WObject.html" title="Wt::WObject" alt="" coords="33,5,129,32"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classDemoTreeList-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#5b07059aecf22b392e2d055cf451b0c7">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#3461e31818c4d2f516641bdaf508312a">parent</a>)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a <a class="el" href="classDemoTreeList.html" title="A demonstration of the treelist.">DemoTreeList</a>.  <a href="#5b07059aecf22b392e2d055cf451b0c7"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Slots</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#59023d58bc5bb025d463935ed6f57b6b">addMap</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a map.  <a href="#59023d58bc5bb025d463935ed6f57b6b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#32e8d75762ff66fcab135cd55c6bcca6">removeMap</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove a map.  <a href="#32e8d75762ff66fcab135cd55c6bcca6"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTreeNode.html">TreeNode</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#c1ddf9da261c37e9255eaa1fb972d6e2">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#3461e31818c4d2f516641bdaf508312a">parent</a>)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a "map" node, and insert in the given parent.  <a href="#c1ddf9da261c37e9255eaa1fb972d6e2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTreeNode.html">TreeNode</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#ef0149499570b8b89cbabe75879e30b6">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#3461e31818c4d2f516641bdaf508312a">parent</a>)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a "file" node, and insert in the given parent.  <a href="#ef0149499570b8b89cbabe75879e30b6"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTreeNode.html">TreeNode</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#5b3471e575b6bf0dfa9e19cc41510d7d">tree_</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTreeNode.html">TreeNode</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#f38b14ae38847b7f8c47d56fe5e89b34">testMap_</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#297ac3606b05e9185efc802cf0ebbadd">testCount_</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WPushButton.html">Wt::WPushButton</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#4f796ef14583c6b7fc0aec13508d83ee">addMapButton_</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WPushButton.html">Wt::WPushButton</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDemoTreeList.html#a77bb14d293f3efde79a47d3b4a5214e">removeMapButton_</a></td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A demonstration of the treelist. 
<p>
This is the main class for the treelist example. 
<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>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="5b07059aecf22b392e2d055cf451b0c7"></a><!-- doxytag: member="DemoTreeList::DemoTreeList" ref="5b07059aecf22b392e2d055cf451b0c7" 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> *&nbsp;</td>
          <td class="paramname"> <em>parent</em>          </td>
          <td>&nbsp;)&nbsp;</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 name="l00021"></a>00021   : <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html#520ba6e52a36a7f2efbef1a31a69e898">WContainerWidget</a>(parent),
<a name="l00022"></a>00022     <a class="code" href="classDemoTreeList.html#297ac3606b05e9185efc802cf0ebbadd">testCount_</a>(0)
<a name="l00023"></a>00023 {
<a name="l00024"></a>00024   <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html#2cfe66d9b62940f889e99538a9f478d2">addWidget</a>
<a name="l00025"></a>00025     (<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">"&lt;h2&gt;Wt Tree List example&lt;/h2&gt;"</span>
<a name="l00026"></a>00026                <span class="stringliteral">"&lt;p&gt;This is a simple demo of a treelist, implemented using"</span>
<a name="l00027"></a>00027                <span class="stringliteral">" &lt;a href='http://witty.sourceforge.net/'&gt;Wt&lt;/a&gt;.&lt;/p&gt;"</span>
<a name="l00028"></a>00028                <span class="stringliteral">"&lt;p&gt;The leafs of the tree contain the source code of the "</span>
<a name="l00029"></a>00029                <span class="stringliteral">"tree-list in the classes &lt;b&gt;TreeNode&lt;/b&gt; and "</span>
<a name="l00030"></a>00030                <span class="stringliteral">"&lt;b&gt;IconPair&lt;/b&gt;, as well as the implementation of this "</span>
<a name="l00031"></a>00031                <span class="stringliteral">"demo itself in the class &lt;b&gt;DemoTreeList&lt;/b&gt;.&lt;/p&gt;"</span>));
<a name="l00032"></a>00032 
<a name="l00033"></a>00033   <a class="code" href="classDemoTreeList.html#5b3471e575b6bf0dfa9e19cc41510d7d">tree_</a> = <a class="code" href="classDemoTreeList.html#c1ddf9da261c37e9255eaa1fb972d6e2" title="Create a &amp;quot;map&amp;quot; node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">"Examples"</span>, 0);
<a name="l00034"></a>00034   <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html#2cfe66d9b62940f889e99538a9f478d2">addWidget</a>(<a class="code" href="classDemoTreeList.html#5b3471e575b6bf0dfa9e19cc41510d7d">tree_</a>);
<a name="l00035"></a>00035 
<a name="l00036"></a>00036   <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *treelist = <a class="code" href="classDemoTreeList.html#c1ddf9da261c37e9255eaa1fb972d6e2" title="Create a &amp;quot;map&amp;quot; node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">"Tree List"</span>, <a class="code" href="classDemoTreeList.html#5b3471e575b6bf0dfa9e19cc41510d7d">tree_</a>);
<a name="l00037"></a>00037   <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *wstateicon = <a class="code" href="classDemoTreeList.html#c1ddf9da261c37e9255eaa1fb972d6e2" title="Create a &amp;quot;map&amp;quot; node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">"class IconPair"</span>, treelist);
<a name="l00038"></a>00038   <a class="code" href="classDemoTreeList.html#ef0149499570b8b89cbabe75879e30b6" title="Create a &amp;quot;file&amp;quot; node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">"&lt;a href=\"IconPair.h\"&gt;IconPair.h&lt;/a&gt;"</span>, wstateicon);
<a name="l00039"></a>00039   <a class="code" href="classDemoTreeList.html#ef0149499570b8b89cbabe75879e30b6" title="Create a &amp;quot;file&amp;quot; node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">"&lt;a href=\"IconPair.C\"&gt;IconPair.C&lt;/a&gt;"</span>, wstateicon);
<a name="l00040"></a>00040   <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *wtreenode = <a class="code" href="classDemoTreeList.html#c1ddf9da261c37e9255eaa1fb972d6e2" title="Create a &amp;quot;map&amp;quot; node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">"class TreeNode"</span>, treelist);
<a name="l00041"></a>00041   <a class="code" href="classDemoTreeList.html#ef0149499570b8b89cbabe75879e30b6" title="Create a &amp;quot;file&amp;quot; node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">"&lt;a href=\"TreeNode.h\"&gt;TreeNode.h&lt;/a&gt;"</span>, wtreenode);
<a name="l00042"></a>00042   <a class="code" href="classDemoTreeList.html#ef0149499570b8b89cbabe75879e30b6" title="Create a &amp;quot;file&amp;quot; node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">"&lt;a href=\"TreeNode.C\"&gt;TreeNode.C&lt;/a&gt;"</span>, wtreenode);
<a name="l00043"></a>00043   <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *demotreelist = <a class="code" href="classDemoTreeList.html#c1ddf9da261c37e9255eaa1fb972d6e2" title="Create a &amp;quot;map&amp;quot; node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">"class DemoTreeList"</span>, treelist);
<a name="l00044"></a>00044   <a class="code" href="classDemoTreeList.html#ef0149499570b8b89cbabe75879e30b6" title="Create a &amp;quot;file&amp;quot; node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">"&lt;a href=\"DemoTreeList.h\"&gt;DemoTreeList.h&lt;/a&gt;"</span>, demotreelist);
<a name="l00045"></a>00045   <a class="code" href="classDemoTreeList.html#ef0149499570b8b89cbabe75879e30b6" title="Create a &amp;quot;file&amp;quot; node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">"&lt;a href=\"DemoTreeList.C\"&gt;DemoTreeList.C&lt;/a&gt;"</span>, demotreelist);
<a name="l00046"></a>00046 
<a name="l00047"></a>00047   <a class="code" href="classDemoTreeList.html#f38b14ae38847b7f8c47d56fe5e89b34">testMap_</a> = <a class="code" href="classDemoTreeList.html#c1ddf9da261c37e9255eaa1fb972d6e2" title="Create a &amp;quot;map&amp;quot; node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">"Test map"</span>, <a class="code" href="classDemoTreeList.html#5b3471e575b6bf0dfa9e19cc41510d7d">tree_</a>);
<a name="l00048"></a>00048 
<a name="l00049"></a>00049   <span class="comment">/*</span>
<a name="l00050"></a>00050 <span class="comment">   * Buttons to dynamically demonstrate changing the tree contents.</span>
<a name="l00051"></a>00051 <span class="comment">   */</span>
<a name="l00052"></a>00052   <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html#2cfe66d9b62940f889e99538a9f478d2">addWidget</a>
<a name="l00053"></a>00053     (<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">"&lt;p&gt;Use the following buttons to change the tree "</span>
<a name="l00054"></a>00054                <span class="stringliteral">"contents:&lt;/p&gt;"</span>));
<a name="l00055"></a>00055 
<a name="l00056"></a>00056   <a class="code" href="classDemoTreeList.html#4f796ef14583c6b7fc0aec13508d83ee">addMapButton_</a>
<a name="l00057"></a>00057     = <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 name="l00058"></a>00058   <a class="code" href="classDemoTreeList.html#4f796ef14583c6b7fc0aec13508d83ee">addMapButton_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WInteractWidget.html#e11e050cce0d4a8f742afa3ef92bfe8c">clicked</a>().connect(SLOT(<span class="keyword">this</span>, <a class="code" href="classDemoTreeList.html#59023d58bc5bb025d463935ed6f57b6b" title="Add a map.">DemoTreeList::addMap</a>));
<a name="l00059"></a>00059 
<a name="l00060"></a>00060   <a class="code" href="classDemoTreeList.html#a77bb14d293f3efde79a47d3b4a5214e">removeMapButton_</a>
<a name="l00061"></a>00061     = <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 name="l00062"></a>00062   <a class="code" href="classDemoTreeList.html#a77bb14d293f3efde79a47d3b4a5214e">removeMapButton_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WInteractWidget.html#e11e050cce0d4a8f742afa3ef92bfe8c">clicked</a>().connect(SLOT(<span class="keyword">this</span>, <a class="code" href="classDemoTreeList.html#32e8d75762ff66fcab135cd55c6bcca6" title="Remove a map.">DemoTreeList::removeMap</a>));
<a name="l00063"></a>00063   <a class="code" href="classDemoTreeList.html#a77bb14d293f3efde79a47d3b4a5214e">removeMapButton_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html#5f68ea0ab29adfb8e559153fca281e03">disable</a>();
<a name="l00064"></a>00064 
<a name="l00065"></a>00065   <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html#2cfe66d9b62940f889e99538a9f478d2">addWidget</a>
<a name="l00066"></a>00066     (<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">"&lt;p&gt;Remarks:"</span>
<a name="l00067"></a>00067                <span class="stringliteral">"&lt;ul&gt;"</span>
<a name="l00068"></a>00068                <span class="stringliteral">"&lt;li&gt;&lt;p&gt;This is not the instantiation of a pre-defined "</span>
<a name="l00069"></a>00069                <span class="stringliteral">"tree list component, but the full implementation of such "</span>
<a name="l00070"></a>00070                <span class="stringliteral">"a component, in about 350 lines of C++ code !&lt;/p&gt; "</span>
<a name="l00071"></a>00071                <span class="stringliteral">"&lt;p&gt;In comparison, the &lt;a href='http://myfaces.apache.org'&gt; "</span>
<a name="l00072"></a>00072                <span class="stringliteral">"Apache MyFaces&lt;/a&gt; JSF implementation of tree2, with similar "</span>
<a name="l00073"></a>00073                <span class="stringliteral">"functionality, uses about 2400 lines of Java, and 140 lines "</span>
<a name="l00074"></a>00074                <span class="stringliteral">"of JavaScript code.&lt;/p&gt;&lt;/li&gt;"</span>
<a name="l00075"></a>00075                <span class="stringliteral">"&lt;li&gt;&lt;p&gt;Once loaded, the tree list does not require any "</span>
<a name="l00076"></a>00076                <span class="stringliteral">"interaction with the server for handling the click events on "</span>
<a name="l00077"></a>00077                <span class="stringliteral">"the &lt;img src='icons/nav-plus-line-middle.gif' /&gt; and "</span>
<a name="l00078"></a>00078                <span class="stringliteral">"&lt;img src='icons/nav-minus-line-middle.gif' /&gt; icons, "</span>
<a name="l00079"></a>00079                <span class="stringliteral">"because these events have been connected to slots using "</span>
<a name="l00080"></a>00080                <span class="stringliteral">"STATIC connections. Such connections are converted to the "</span>
<a name="l00081"></a>00081                <span class="stringliteral">"appropriate JavaScript code that is inserted into the page. "</span>
<a name="l00082"></a>00082                <span class="stringliteral">"Still, the events are signaled to the server to update the "</span>
<a name="l00083"></a>00083                <span class="stringliteral">"application state.&lt;/p&gt;&lt;/li&gt;"</span>
<a name="l00084"></a>00084                <span class="stringliteral">"&lt;li&gt;&lt;p&gt;In contrast, the buttons for manipulating the tree "</span>
<a name="l00085"></a>00085                <span class="stringliteral">"contents use DYNAMIC connections, and thus the update "</span>
<a name="l00086"></a>00086                <span class="stringliteral">"is computed at server-side, and communicated back to the "</span>
<a name="l00087"></a>00087                <span class="stringliteral">"browser (by default using AJAX).&lt;/p&gt;&lt;/li&gt;"</span>
<a name="l00088"></a>00088                <span class="stringliteral">"&lt;li&gt;&lt;p&gt;When loading a page, only visible widgets (that are not "</span>
<a name="l00089"></a>00089                <span class="stringliteral">"&lt;b&gt;setHidden(true)&lt;/b&gt;) are transmitted. "</span>
<a name="l00090"></a>00090                <span class="stringliteral">"The remaining widgets are loaded in the background after "</span>
<a name="l00091"></a>00091                <span class="stringliteral">"rendering the page. "</span>
<a name="l00092"></a>00092                <span class="stringliteral">"As a result the application is loaded as fast as possible.&lt;/p&gt;"</span>
<a name="l00093"></a>00093                <span class="stringliteral">"&lt;/li&gt;"</span>
<a name="l00094"></a>00094                <span class="stringliteral">"&lt;li&gt;&lt;p&gt;The browser reload button is supported and behaves as "</span>
<a name="l00095"></a>00095                <span class="stringliteral">"expected: the page is reloaded from the server. Again, "</span>
<a name="l00096"></a>00096                <span class="stringliteral">"only visible widgets are transmitted immediately.&lt;/p&gt; "</span>
<a name="l00097"></a>00097                <span class="stringliteral">"&lt;p&gt;(For the curious, this is the way to see the actual "</span>
<a name="l00098"></a>00098                <span class="stringliteral">"HTML/JavaScript code !)&lt;/p&gt;&lt;/li&gt;"</span>
<a name="l00099"></a>00099                <span class="stringliteral">"&lt;/ul&gt;&lt;/p&gt;"</span>));
<a name="l00100"></a>00100 }
</pre></div>
<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="59023d58bc5bb025d463935ed6f57b6b"></a><!-- doxytag: member="DemoTreeList::addMap" ref="59023d58bc5bb025d463935ed6f57b6b" 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>&nbsp;)&nbsp;</td>
          <td><code> [private, slot]</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 name="l00103"></a>00103 {
<a name="l00104"></a>00104   <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *node
<a name="l00105"></a>00105     = <a class="code" href="classDemoTreeList.html#c1ddf9da261c37e9255eaa1fb972d6e2" title="Create a &amp;quot;map&amp;quot; node, and insert in the given parent.">makeTreeMap</a>(<span class="stringliteral">"Map "</span> + boost::lexical_cast&lt;std::string&gt;(++<a class="code" href="classDemoTreeList.html#297ac3606b05e9185efc802cf0ebbadd">testCount_</a>),
<a name="l00106"></a>00106                   <a class="code" href="classDemoTreeList.html#f38b14ae38847b7f8c47d56fe5e89b34">testMap_</a>);
<a name="l00107"></a>00107   <a class="code" href="classDemoTreeList.html#ef0149499570b8b89cbabe75879e30b6" title="Create a &amp;quot;file&amp;quot; node, and insert in the given parent.">makeTreeFile</a>(<span class="stringliteral">"File "</span> + boost::lexical_cast&lt;std::string&gt;(<a class="code" href="classDemoTreeList.html#297ac3606b05e9185efc802cf0ebbadd">testCount_</a>),
<a name="l00108"></a>00108                node);
<a name="l00109"></a>00109 
<a name="l00110"></a>00110   <a class="code" href="classDemoTreeList.html#a77bb14d293f3efde79a47d3b4a5214e">removeMapButton_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html#e6935d8baca9d37dd1d080b4383da87c">enable</a>();
<a name="l00111"></a>00111 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="32e8d75762ff66fcab135cd55c6bcca6"></a><!-- doxytag: member="DemoTreeList::removeMap" ref="32e8d75762ff66fcab135cd55c6bcca6" 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>&nbsp;)&nbsp;</td>
          <td><code> [private, slot]</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"><a name="l00114"></a>00114 {
<a name="l00115"></a>00115   <span class="keywordtype">int</span> numMaps = <a class="code" href="classDemoTreeList.html#f38b14ae38847b7f8c47d56fe5e89b34">testMap_</a>-&gt;<a class="code" href="classTreeNode.html#73afc6b5f7587505a5c1ba1cf2a51341" title="Get the list of children.">childNodes</a>().size();
<a name="l00116"></a>00116 
<a name="l00117"></a>00117   <span class="keywordflow">if</span> (numMaps &gt; 0) {
<a name="l00118"></a>00118     <span class="keywordtype">int</span> c = rand() % numMaps;
<a name="l00119"></a>00119 
<a name="l00120"></a>00120     <a class="code" href="classTreeNode.html" title="Example implementation of a single tree list node.">TreeNode</a> *child = <a class="code" href="classDemoTreeList.html#f38b14ae38847b7f8c47d56fe5e89b34">testMap_</a>-&gt;<a class="code" href="classTreeNode.html#73afc6b5f7587505a5c1ba1cf2a51341" title="Get the list of children.">childNodes</a>()[c];
<a name="l00121"></a>00121     <a class="code" href="classDemoTreeList.html#f38b14ae38847b7f8c47d56fe5e89b34">testMap_</a>-&gt;<a class="code" href="classTreeNode.html#a772a12f5220a2256247048a1edcc581" title="Remove a child node.">removeChildNode</a>(child);
<a name="l00122"></a>00122     <span class="keyword">delete</span> child;
<a name="l00123"></a>00123 
<a name="l00124"></a>00124     <span class="keywordflow">if</span> (numMaps == 1)
<a name="l00125"></a>00125       <a class="code" href="classDemoTreeList.html#a77bb14d293f3efde79a47d3b4a5214e">removeMapButton_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html#5f68ea0ab29adfb8e559153fca281e03">disable</a>();
<a name="l00126"></a>00126   }
<a name="l00127"></a>00127 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="c1ddf9da261c37e9255eaa1fb972d6e2"></a><!-- doxytag: member="DemoTreeList::makeTreeMap" ref="c1ddf9da261c37e9255eaa1fb972d6e2" 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&nbsp;</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> *&nbsp;</td>
          <td class="paramname"> <em>parent</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <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 name="l00130"></a>00130 {
<a name="l00131"></a>00131   <a class="code" href="classIconPair.html" title="An icon pair (identical to WIconPair).">IconPair</a> *labelIcon
<a name="l00132"></a>00132     = <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>,
<a name="l00133"></a>00133                    <span class="stringliteral">"icons/yellow-folder-open.png"</span>,
<a name="l00134"></a>00134                    <span class="keyword">false</span>);
<a name="l00135"></a>00135 
<a name="l00136"></a>00136   <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);
<a name="l00137"></a>00137   <span class="keywordflow">if</span> (parent)
<a name="l00138"></a>00138     parent-&gt;<a class="code" href="classTreeNode.html#a3bca1b27d9cbb05b0fa13504498179e" title="Add a child node.">addChildNode</a>(node);
<a name="l00139"></a>00139 
<a name="l00140"></a>00140   <span class="keywordflow">return</span> node;
<a name="l00141"></a>00141 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="ef0149499570b8b89cbabe75879e30b6"></a><!-- doxytag: member="DemoTreeList::makeTreeFile" ref="ef0149499570b8b89cbabe75879e30b6" 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&nbsp;</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> *&nbsp;</td>
          <td class="paramname"> <em>parent</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <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 name="l00145"></a>00145 {
<a name="l00146"></a>00146   <a class="code" href="classIconPair.html" title="An icon pair (identical to WIconPair).">IconPair</a> *labelIcon
<a name="l00147"></a>00147     = <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>,
<a name="l00148"></a>00148                    <span class="keyword">false</span>);
<a name="l00149"></a>00149 
<a name="l00150"></a>00150   <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);
<a name="l00151"></a>00151   <span class="keywordflow">if</span> (parent)
<a name="l00152"></a>00152     parent-&gt;<a class="code" href="classTreeNode.html#a3bca1b27d9cbb05b0fa13504498179e" title="Add a child node.">addChildNode</a>(node);
<a name="l00153"></a>00153 
<a name="l00154"></a>00154   <span class="keywordflow">return</span> node;
<a name="l00155"></a>00155 }
</pre></div>
<p>

</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="5b3471e575b6bf0dfa9e19cc41510d7d"></a><!-- doxytag: member="DemoTreeList::tree_" ref="5b3471e575b6bf0dfa9e19cc41510d7d" 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#5b3471e575b6bf0dfa9e19cc41510d7d">DemoTreeList::tree_</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="DemoTreeList_8h-source.html#l00044">44</a> of file <a class="el" href="DemoTreeList_8h-source.html">DemoTreeList.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="f38b14ae38847b7f8c47d56fe5e89b34"></a><!-- doxytag: member="DemoTreeList::testMap_" ref="f38b14ae38847b7f8c47d56fe5e89b34" 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#f38b14ae38847b7f8c47d56fe5e89b34">DemoTreeList::testMap_</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="DemoTreeList_8h-source.html#l00045">45</a> of file <a class="el" href="DemoTreeList_8h-source.html">DemoTreeList.h</a>.</p>

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

<p>

<p>Definition at line <a class="el" href="DemoTreeList_8h-source.html#l00046">46</a> of file <a class="el" href="DemoTreeList_8h-source.html">DemoTreeList.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="4f796ef14583c6b7fc0aec13508d83ee"></a><!-- doxytag: member="DemoTreeList::addMapButton_" ref="4f796ef14583c6b7fc0aec13508d83ee" 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#4f796ef14583c6b7fc0aec13508d83ee">DemoTreeList::addMapButton_</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="DemoTreeList_8h-source.html#l00048">48</a> of file <a class="el" href="DemoTreeList_8h-source.html">DemoTreeList.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="a77bb14d293f3efde79a47d3b4a5214e"></a><!-- doxytag: member="DemoTreeList::removeMapButton_" ref="a77bb14d293f3efde79a47d3b4a5214e" 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#a77bb14d293f3efde79a47d3b4a5214e">DemoTreeList::removeMapButton_</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="DemoTreeList_8h-source.html#l00049">49</a> of file <a class="el" href="DemoTreeList_8h-source.html">DemoTreeList.h</a>.</p>

</div>
</div><p>
<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>/home/koen/project/wt/public-git/wt/examples/treelist/<a class="el" href="DemoTreeList_8C-source.html">DemoTreeList.C</a></ul>
</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>