Wt examples
3.3.1
|
A list of options, separated by '|'. More...
#include <OptionList.h>
Public Member Functions | |
OptionList (WContainerWidget *parent=0) | |
Create an OptionList. More... | |
void | add (Option *option) |
Add an Option to the list. More... | |
void | update () |
Updates the stateless implementations after an Option has been hidden or shown. More... | |
![]() | |
virtual void | setPositionScheme (PositionScheme scheme)=0 |
virtual PositionScheme | positionScheme () const =0 |
virtual void | setOffsets (const WLength &offset, WFlags< Side > sides=All)=0 |
virtual WLength | offset (Side side) const =0 |
virtual void | resize (const WLength &width, const WLength &height) |
virtual WLength | width () const =0 |
virtual WLength | height () const =0 |
virtual void | setMinimumSize (const WLength &width, const WLength &height)=0 |
virtual WLength | minimumWidth () const =0 |
virtual WLength | minimumHeight () const =0 |
virtual void | setMaximumSize (const WLength &width, const WLength &height)=0 |
virtual WLength | maximumWidth () const =0 |
virtual WLength | maximumHeight () const =0 |
virtual void | setLineHeight (const WLength &height)=0 |
virtual WLength | lineHeight () const =0 |
virtual void | setFloatSide (Side s)=0 |
virtual Side | floatSide () const =0 |
virtual void | setClearSides (WFlags< Side > sides)=0 |
virtual WFlags< Side > | clearSides () const =0 |
virtual void | setMargin (const WLength &margin, WFlags< Side > sides=All)=0 |
virtual WLength | margin (Side side) const =0 |
virtual void | setHiddenKeepsGeometry (bool enabled)=0 |
virtual bool | hiddenKeepsGeometry () const =0 |
virtual void | setHidden (bool hidden, const WAnimation &animation=WAnimation())=0 |
virtual bool | isHidden () const =0 |
virtual bool | isVisible () const =0 |
virtual void | setDisabled (bool disabled)=0 |
virtual bool | isDisabled () const =0 |
virtual bool | isEnabled () const =0 |
virtual void | setPopup (bool popup)=0 |
virtual bool | isPopup () const =0 |
virtual void | setInline (bool inlined)=0 |
virtual bool | isInline () const =0 |
virtual void | setDecorationStyle (const WCssDecorationStyle &style)=0 |
virtual WCssDecorationStyle & | decorationStyle ()=0 |
virtual void | setStyleClass (const WString &styleClass)=0 |
virtual WString | styleClass () const =0 |
virtual void | addStyleClass (const WString &styleClass, bool force=false)=0 |
virtual void | removeStyleClass (const WString &styleClass, bool force=false)=0 |
virtual bool | hasStyleClass (const WString &styleClass) const =0 |
virtual void | setVerticalAlignment (AlignmentFlag alignment, const WLength &length=WLength::Auto)=0 |
virtual AlignmentFlag | verticalAlignment () const =0 |
virtual WLength | verticalAlignmentLength () const =0 |
virtual void | setToolTip (const WString &text, TextFormat textFormat=PlainText)=0 |
virtual const WString & | toolTip () const =0 |
virtual void | refresh () |
virtual void | setAttributeValue (const std::string &name, const WString &value)=0 |
virtual WString | attributeValue (const std::string &name) const =0 |
virtual void | setJavaScriptMember (const std::string &name, const std::string &value)=0 |
virtual std::string | javaScriptMember (const std::string &name) const =0 |
virtual void | callJavaScriptMember (const std::string &name, const std::string &args)=0 |
virtual void | load ()=0 |
virtual bool | loaded () const =0 |
virtual void | setTabIndex (int index)=0 |
virtual int | tabIndex () const =0 |
virtual void | setId (const std::string &id)=0 |
virtual WWidget * | find (const std::string &name)=0 |
virtual void | setSelectable (bool selectable)=0 |
virtual void | doJavaScript (const std::string &js)=0 |
Private Member Functions | |
void | optionVisibilityChanged (Option *opt, bool hidden) |
An option changed visibility: possibly update the separators inbetween. More... | |
Private Attributes | |
std::vector< Option * > | options_ |
The list of options. More... | |
Option * | optionNeedReset_ |
The option that needs its stateless code updated. More... | |
Friends | |
class | Option |
Additional Inherited Members | |
![]() | |
virtual void | enableAjax ()=0 |
virtual void | propagateSetEnabled (bool enabled)=0 |
virtual void | render (WFlags< RenderFlag > flags) |
A list of options, separated by '|'.
This widget is part of the Wt composer example.
An OptionList displays a list of Option widgets, which are separated by a '|' separator.
For example, Foo | Bar | Huu
When Options are hidden, the separators are adjusted so that there is no separator after the last visible option. However, this requires a call of update() each time an option is hidden or shown. This is because the removing of separators is optimized in stateless implementations, and thus in client-side JavaScript code. Since the behaviour is not entirely stateless, the update() method resets stateless implementations if necessary.
Definition at line 40 of file OptionList.h.
OptionList::OptionList | ( | WContainerWidget * | parent = 0 | ) |
Create an OptionList.
Definition at line 11 of file OptionList.C.
void OptionList::add | ( | Option * | option | ) |
Add an Option to the list.
Definition at line 18 of file OptionList.C.
|
private |
An option changed visibility: possibly update the separators inbetween.
Definition at line 38 of file OptionList.C.
void OptionList::update | ( | ) |
Updates the stateless implementations after an Option has been hidden or shown.
Definition at line 30 of file OptionList.C.
|
friend |
Definition at line 66 of file OptionList.h.
|
private |
The option that needs its stateless code updated.
Definition at line 61 of file OptionList.h.
|
private |
The list of options.
Definition at line 58 of file OptionList.h.