10 #include <Wt/WCompositeWidget.h> 70 TreeNode(
const std::string labelText,
72 std::unique_ptr<IconPair> labelIcon);
76 void addChildNode(std::unique_ptr<TreeNode> node);
80 void removeChildNode(
TreeNode *node,
int index);
84 const std::vector<TreeNode *>&
childNodes()
const {
return childNodes_; }
123 void adjustExpandIcon();
126 bool isLastChildNode()
const;
129 void childNodesChanged();
143 static std::string imageLine_[];
144 static std::string imagePlus_[];
145 static std::string imageMin_[];
150 #endif // WTREENODE_H_ WContainerWidget * expandedContent_
The container in which the children are managed.
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.
const std::vector< TreeNode * > & childNodes() const
Returns the list of children.
WText * childCountLabel_
The children count '(x)' for x children.
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.
WTable * layout_
Layout (2x2 table).
WImage * noExpandIcon_
The single image shown instead of the expand/collapse icon when no children.
std::unique_ptr< WText > labelText_
The label.
Example implementation of a single tree list node.