6#include <boost/lexical_cast.hpp>
9#include <Wt/WTableCell>
12#include <Wt/WCssDecorationStyle>
20 "icons/line-last.gif" };
22 "icons/nav-plus-line-last.gif" };
24 "icons/nav-minus-line-last.gif" };
30 :
Wt::WCompositeWidget(parent),
An icon pair (identical to WIconPair)
void setState(int num)
Set which icon should be visible.
Wt::WImage * icon1() const
Get the first icon image.
Wt::WImage * icon2() const
Get the second icon image.
Wt::EventSignal< Wt::WMouseEvent > & icon2Clicked
Signal emitted when clicked while in state 1 (icon 2 is shown).
Wt::EventSignal< Wt::WMouseEvent > & icon1Clicked
Signal emitted when clicked while in state 0 (icon 1 is shown).
Example implementation of a single tree list node.
void undoCollapse()
Undo function for prelearning collapse()
Wt::WContainerWidget * expandedContent_
The container in which the children are managed.
std::vector< TreeNode * > childNodes_
List of child nodes.
void undoExpand()
Undo function for prelearning expand()
Wt::WTable * layout_
Layout (2x2 table).
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.
Wt::WText * childCountLabel_
The children count '(x)' for x children.
static std::string imagePlus_[]
void collapse()
Collapses this node.
bool isLastChildNode() const
Returns if is the last child within its parent (is rendered differently)
ImageIndex
Two sets of images, for a normal node, and for the last node.
Wt::WText * labelText_
The label.
Wt::WImage * noExpandIcon_
The single image shown instead of the expand/collapse icon when no children.
void addChildNode(TreeNode *node)
Adds a child node.
void removeChildNode(TreeNode *node)
Removes a child node.
static std::string imageMin_[]
void expand()
Expands this node.
TreeNode * parentNode_
The parent node.
void adjustExpandIcon()
Adjust the expand icon.
IconPair * labelIcon_
The icon next to the label.
TreeNode(const std::string labelText, Wt::TextFormat labelFormat, IconPair *labelIcon, Wt::WContainerWidget *parent=0)
Construct a tree node with the given label.
Wt::Signals::connection connect(const F &function)
void setBackgroundImage(const WLink &link, Repeat repeat=RepeatXY, WFlags< Side > sides=0)
void setImageLink(const WLink &link)
const WLink & imageLink() const
WStatelessSlot * implementStateless(void(T::*method)())
WTableCell * elementAt(int row, int column)
bool setText(const WString &text)
bool setTextFormat(TextFormat format)