10#include <Wt/WCompositeWidget.h>
70 TreeNode(
const std::string labelText,
71 TextFormat labelFormat,
72 std::unique_ptr<IconPair> labelIcon);
An icon pair (identical to WIconPair)
Example implementation of a single tree list node.
void undoCollapse()
Undo function for prelearning collapse()
void removeChildNode(TreeNode *node, int index)
Removes a child node.
std::vector< TreeNode * > childNodes_
List of child nodes.
void undoExpand()
Undo function for prelearning expand()
void childNodesChanged()
Rerender when children have changed.
static std::string imageLine_[]
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).
static std::string imagePlus_[]
void collapse()
Collapses this node.
bool isLastChildNode() const
Returns if is the last child within its parent (is rendered differently)
WContainerWidget * expandedContent_
The container in which the children are managed.
const std::vector< TreeNode * > & childNodes() const
Returns the list of children.
ImageIndex
Two sets of images, for a normal node, and for the last node.
WText * childCountLabel_
The children count '(x)' for x children.
static std::string imageMin_[]
void expand()
Expands this node.
void addChildNode(std::unique_ptr< TreeNode > node)
Adds a child node.
TreeNode * parentNode_
The parent node.
void adjustExpandIcon()
Adjust the expand icon.
IconPair * labelIcon_
The icon next to the label.
WImage * noExpandIcon_
The single image shown instead of the expand/collapse icon when no children.