10 #include <Wt/WCompositeWidget> 68 TreeNode(
const std::string labelText,
78 void removeChildNode(
TreeNode *node);
82 const std::vector<TreeNode *>&
childNodes()
const {
return childNodes_; }
121 void adjustExpandIcon();
124 bool isLastChildNode()
const;
127 void childNodesChanged();
141 static std::string imageLine_[];
142 static std::string imagePlus_[];
143 static std::string imageMin_[];
148 #endif // WTREENODE_H_ An icon pair (identical to WIconPair)
ImageIndex
Two sets of images, for a normal node, and for the last node.
TreeNode * parentNode_
The parent node.
Wt::WContainerWidget * expandedContent_
The container in which the children are managed.
Wt::WImage * noExpandIcon_
The single image shown instead of the expand/collapse icon when no children.
Wt::WTable * layout_
Layout (2x2 table).
Wt::WText * childCountLabel_
The children count '(x)' for x children.
Wt::WText * labelText_
The label.
std::vector< TreeNode * > childNodes_
List of child nodes.
IconPair * labelIcon_
The icon next to the label.
bool wasCollapsed_
Was collapsed (for undo of prelearned collapse() and expand() slots.
IconPair * expandIcon_
The icon for expanding or collapsing.
const std::vector< TreeNode * > & childNodes() const
Returns the list of children.
Example implementation of a single tree list node.