Wt examples  4.9.0
Loading...
Searching...
No Matches
DemoTreeList.h
Go to the documentation of this file.
1// This may look like C code, but it's really -*- C++ -*-
2/*
3 * Copyright (C) 2008 Emweb bv, Herent, Belgium.
4 *
5 * See the LICENSE file for terms of use.
6 */
7#ifndef DEMO_TREE_LIST
8#define DEMO_TREE_LIST
9
10#include <Wt/WContainerWidget.h>
11
12using namespace Wt;
13
14namespace Wt {
15 class WPushButton;
16}
17
18class TreeNode;
19
24
29class DemoTreeList : public WContainerWidget
30{
31public:
35
36private:
40
41 WPushButton *addFolderButton_;
42 WPushButton *removeFolderButton_;
43
46 void addFolder();
47
50 void removeFolder();
51
54 TreeNode *makeTreeFolder(const std::string name, TreeNode *parent);
55
58 std::unique_ptr<TreeNode> makeTreeFolder(const std::string name);
59
62 TreeNode *makeTreeFile(const std::string name, TreeNode *parent);
63
66 std::unique_ptr<TreeNode> makeTreeFile(const std::string name);
67};
68
71#endif // DEMO_TREE_LIST
A demonstration of the treelist.
Definition: DemoTreeList.h:30
TreeNode * testFolder_
Definition: DemoTreeList.h:38
TreeNode * tree_
Definition: DemoTreeList.h:37
void removeFolder()
Remove a folder.
Definition: DemoTreeList.C:110
void addFolder()
Add a folder.
Definition: DemoTreeList.C:101
DemoTreeList()
Create a DemoTreeList.
Definition: DemoTreeList.C:19
TreeNode * makeTreeFolder(const std::string name, TreeNode *parent)
Create a "folder" node, and insert in the given parent.
Definition: DemoTreeList.C:125
WPushButton * removeFolderButton_
Definition: DemoTreeList.h:42
TreeNode * makeTreeFile(const std::string name, TreeNode *parent)
Create a "file" node, and insert in the given parent.
Definition: DemoTreeList.C:152
WPushButton * addFolderButton_
Definition: DemoTreeList.h:41
Example implementation of a single tree list node.
Definition: TreeNode.h:58