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_; }
120 void adjustExpandIcon();
123 bool isLastChildNode()
const;
126 void childNodesChanged();
140 static std::string imageLine_[];
141 static std::string imagePlus_[];
142 static std::string imageMin_[];
An icon pair (identical to WIconPair)
Example implementation of a single tree list node.
std::vector< TreeNode * > childNodes_
List of child nodes.
IconPair * expandIcon_
The icon for expanding or collapsing.
bool wasCollapsed_
Was collapsed (for undo of prelearned collapse() and expand() slots.
WTable * layout_
Layout (2x2 table).
WContainerWidget * expandedContent_
The container in which the children are managed.
ImageIndex
Two sets of images, for a normal node, and for the last node.
WText * childCountLabel_
The children count '(x)' for x children.
TreeNode * parentNode_
The parent node.
const std::vector< TreeNode * > & childNodes() const
Returns the list of children.
IconPair * labelIcon_
The icon next to the label.
WImage * noExpandIcon_
The single image shown instead of the expand/collapse icon when no children.