A clickable option.
More...
#include <Option.h>
|
| Option (const WString &text) |
| Create an Option with the given text.
|
void | setText (const WString &text) |
| Change the text.
|
WInteractWidget * | item () |
| Returns the clickable part.
|
virtual void | setHidden (bool hidden, const WAnimation &animation=WAnimation()) |
|
WText * | option_ |
| The option command text.
|
WText * | sep_ |
| The separator '|'.
|
OptionList * | list_ |
| The list in which this option is managed, if managed.
|
A clickable option.
This widget is part of the Wt composer example.
On its own, an option is a text which is style "option". An Option may also be used as items in an OptionList.
- See also
- OptionList
Definition at line 31 of file Option.h.
◆ Option()
Option::Option |
( |
const WString & | text | ) |
|
Create an Option with the given text.
Definition at line 12 of file Option.C.
13 : WContainerWidget(),
16{
17 setInline(true);
18
19 option_ = this->addWidget(std::make_unique<WText>(text));
20 option_->setStyleClass(
"option");
21}
WText * option_
The option command text.
WText * sep_
The separator '|'.
OptionList * list_
The list in which this option is managed, if managed.
◆ addSeparator()
void Option::addSeparator |
( |
| ) |
|
|
private |
Create and show the separator.
Definition at line 33 of file Option.C.
34{
35 sep_ = this->addWidget(std::make_unique<WText>(
"|"));
36 sep_->setStyleClass(
"sep");
37}
◆ hideSeparator()
void Option::hideSeparator |
( |
| ) |
|
|
private |
Hide the separator.
Definition at line 39 of file Option.C.
◆ item()
WInteractWidget * Option::item |
( |
| ) |
|
|
inline |
Returns the clickable part.
Definition at line 44 of file Option.h.
◆ setHidden()
void Option::setHidden |
( |
bool | hidden, |
|
|
const WAnimation & | animation = WAnimation() ) |
|
virtual |
Definition at line 49 of file Option.C.
50{
51 WContainerWidget::setHidden(hidden, animation);
52
54 list_->optionVisibilityChanged(
this, hidden);
55}
◆ setOptionList()
◆ setText()
void Option::setText |
( |
const WString & | text | ) |
|
Change the text.
Definition at line 23 of file Option.C.
◆ showSeparator()
void Option::showSeparator |
( |
| ) |
|
|
private |
Show the separator.
Definition at line 44 of file Option.C.
◆ OptionList
◆ list_
The list in which this option is managed, if managed.
Definition at line 57 of file Option.h.
◆ option_
The option command text.
Definition at line 51 of file Option.h.
◆ sep_
The separator '|'.
Definition at line 54 of file Option.h.
The documentation for this class was generated from the following files: