Wt examples  4.10.4
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.
TreeNode * testFolder_
TreeNode * tree_
void removeFolder()
Remove a folder.
void addFolder()
Add a folder.
DemoTreeList()
Create a DemoTreeList.
TreeNode * makeTreeFolder(const std::string name, TreeNode *parent)
Create a "folder" node, and insert in the given parent.
WPushButton * removeFolderButton_
TreeNode * makeTreeFile(const std::string name, TreeNode *parent)
Create a "file" node, and insert in the given parent.
WPushButton * addFolderButton_
Example implementation of a single tree list node.
Definition TreeNode.h:58