|
| TreeNode (const std::string labelText, Wt::TextFormat labelFormat, IconPair *labelIcon, Wt::WContainerWidget *parent=0) |
| Construct a tree node with the given label. More...
|
|
void | addChildNode (TreeNode *node) |
| Adds a child node. More...
|
|
void | removeChildNode (TreeNode *node) |
| Removes a child node. More...
|
|
const std::vector< TreeNode * > & | childNodes () const |
| Returns the list of children. More...
|
|
void | collapse () |
| Collapses this node. More...
|
|
void | expand () |
| Expands this node. More...
|
|
| WCompositeWidget (WContainerWidget *parent=0) |
|
| WCompositeWidget (WWidget *implementation, WContainerWidget *parent) |
|
virtual const std::string | id () const |
|
virtual void | setPositionScheme (PositionScheme scheme) |
|
virtual PositionScheme | positionScheme () const |
|
virtual void | setOffsets (const WLength &offset, WFlags< Side > sides=All) |
|
virtual WLength | offset (Side s) const |
|
virtual void | resize (const WLength &width, const WLength &height) |
|
virtual WLength | width () const |
|
virtual WLength | height () const |
|
virtual void | setMinimumSize (const WLength &width, const WLength &height) |
|
virtual WLength | minimumWidth () const |
|
virtual WLength | minimumHeight () const |
|
virtual void | setMaximumSize (const WLength &width, const WLength &height) |
|
virtual WLength | maximumWidth () const |
|
virtual WLength | maximumHeight () const |
|
virtual void | setLineHeight (const WLength &height) |
|
virtual WLength | lineHeight () const |
|
virtual void | setFloatSide (Side s) |
|
virtual Side | floatSide () const |
|
virtual void | setClearSides (WFlags< Side > sides) |
|
virtual WFlags< Side > | clearSides () const |
|
virtual void | setMargin (const WLength &margin, WFlags< Side > sides=All) |
|
virtual WLength | margin (Side side) const |
|
virtual void | setHiddenKeepsGeometry (bool enabled) |
|
virtual bool | hiddenKeepsGeometry () const |
|
virtual void | setHidden (bool hidden, const WAnimation &animation=WAnimation()) |
|
virtual bool | isHidden () const |
|
virtual bool | isVisible () const |
|
virtual void | setDisabled (bool disabled) |
|
virtual bool | isDisabled () const |
|
virtual bool | isEnabled () const |
|
virtual void | setPopup (bool popup) |
|
virtual bool | isPopup () const |
|
virtual void | setInline (bool isInline) |
|
virtual bool | isInline () const |
|
virtual void | setDecorationStyle (const WCssDecorationStyle &style) |
|
virtual WCssDecorationStyle & | decorationStyle () |
|
virtual void | setStyleClass (const WString &styleClass) |
|
virtual WString | styleClass () const |
|
virtual void | addStyleClass (const WString &styleClass, bool force=false) |
|
virtual void | removeStyleClass (const WString &styleClass, bool force=false) |
|
virtual bool | hasStyleClass (const WString &styleClass) const |
|
virtual void | setVerticalAlignment (AlignmentFlag alignment, const WLength &length=WLength::Auto) |
|
virtual AlignmentFlag | verticalAlignment () const |
|
virtual WLength | verticalAlignmentLength () const |
|
virtual void | setToolTip (const WString &text, TextFormat textFormat=PlainText) |
|
virtual const WString & | toolTip () const |
|
virtual void | refresh () |
|
virtual void | setAttributeValue (const std::string &name, const WString &value) |
|
virtual WString | attributeValue (const std::string &name) const |
|
virtual void | setJavaScriptMember (const std::string &name, const std::string &value) |
|
virtual std::string | javaScriptMember (const std::string &name) const |
|
virtual void | callJavaScriptMember (const std::string &name, const std::string &args) |
|
virtual void | load () |
|
virtual bool | loaded () const |
|
virtual void | setTabIndex (int index) |
|
virtual int | tabIndex () const |
|
virtual void | setId (const std::string &id) |
|
virtual WWidget * | find (const std::string &name) |
|
virtual void | setSelectable (bool selectable) |
|
virtual void | doJavaScript (const std::string &js) |
|
virtual void | propagateSetEnabled (bool enabled) |
|
virtual | ~WWidget () |
|
WWidget * | parent () const |
|
void | setWidth (const WLength &width) |
|
void | setHeight (const WLength &height) |
|
virtual void | positionAt (const WWidget *widget, Orientation orientation=Vertical) |
|
virtual void | toggleStyleClass (const WString &styleClass, bool add, bool force=false) |
|
std::string | jsRef () const |
|
virtual void | acceptDrops (const std::string &mimeType, const WString &hoverStyleClass=WString()) |
|
virtual void | stopAcceptDrops (const std::string &mimeType) |
|
virtual void | htmlText (std::ostream &out) |
|
bool | isRendered () const |
|
void | hide () |
|
void | animateHide (const WAnimation &animation) |
|
void | show () |
|
void | animateShow (const WAnimation &animation) |
|
void | enable () |
|
void | disable () |
|
bool | layoutSizeAware () const |
|
| WObject (WObject *parent=0) |
|
virtual | ~WObject () |
|
void | setObjectName (const std::string &name) |
|
virtual std::string | objectName () const |
|
void | resetLearnedSlots () |
|
void | resetLearnedSlot (void(T::*method)()) |
|
WStatelessSlot * | implementStateless (void(T::*method)()) |
|
WStatelessSlot * | implementStateless (void(T::*method)(), void(T::*undoMethod)()) |
|
WStatelessSlot * | implementJavaScript (void(T::*method)(), const std::string &jsCode) |
|
void | addChild (WObject *child) |
|
virtual void | removeChild (WObject *child) |
|
const std::vector< WObject * > & | children () const |
|
WObject * | parent () const |
|
Example implementation of a single tree list node.
This is an example of a basic treelist implementation. As of version 1.1.8, a more flexible treenode implementation is included as part of the library: WTreeNode.
A tree list is constructed by nesting TreeNode objects in a tree hierarchy.
A TreeNode has a label, and optionally a two-state label icon, which defines a different image depending on the state of the node (expanded or collapsed). When the node has any children, a child count is also indicated.
Next to the icons, two style classes determine the look of a TreeNode: the label has style "treenodelabel", and the child count has as style "treenodechildcount".
Use CSS nested selectors to apply different styles to different treenodes. For example, to style the treenode with style class "mynode":
The behaviour of the tree node is to collapse all children when the node is expanded (this is similar to how most tree node implementations work).
The widget uses a number of images which must be available in an "icons/" folder (see the Wt treelist examples).
This widget is part of the Wt treelist example.
Definition at line 55 of file TreeNode.h.