Wt examples
3.7.1
public-git
wt
examples
composer
Option.C
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2008 Emweb bv, Herent, Belgium.
3
*
4
* See the LICENSE file for terms of use.
5
*/
6
7
#include <Wt/WText>
8
9
#include "
Option.h
"
10
#include "
OptionList.h
"
11
12
Option::Option
(
const
WString
& text,
WContainerWidget
*parent)
13
:
WContainerWidget
(parent),
14
sep_(0),
15
list_(0)
16
{
17
setInline
(
true
);
18
19
option_
=
new
WText
(text,
this
);
20
option_
->
setStyleClass
(
"option"
);
21
}
22
23
void
Option::setText
(
const
WString
& text)
24
{
25
option_
->
setText
(text);
26
}
27
28
void
Option::setOptionList
(
OptionList
*l)
29
{
30
list_
= l;
31
}
32
33
void
Option::addSeparator
()
34
{
35
sep_
=
new
WText
(
"|"
,
this
);
36
sep_
->
setStyleClass
(
"sep"
);
37
}
38
39
void
Option::hideSeparator
()
40
{
41
sep_
->
hide
();
42
}
43
44
void
Option::showSeparator
()
45
{
46
sep_
->
show
();
47
}
48
49
void
Option::setHidden
(
bool
hidden,
const
WAnimation
& animation)
50
{
51
WContainerWidget::setHidden(hidden, animation);
52
53
if
(
list_
)
54
list_
->
optionVisibilityChanged
(
this
, hidden);
55
}
Option::Option
Option(const WString &text, WContainerWidget *parent=0)
Create an Option with the given text.
Definition:
Option.C:12
Option::setOptionList
void setOptionList(OptionList *l)
Definition:
Option.C:28
Wt::WWebWidget::setStyleClass
virtual void setStyleClass(const WString &styleClass) override
Option::hideSeparator
void hideSeparator()
Hide the separator.
Definition:
Option.C:39
Option::showSeparator
void showSeparator()
Show the separator.
Definition:
Option.C:44
OptionList.h
Wt::WWidget::show
void show()
Option.h
Wt::WText
Wt::WWidget::hide
void hide()
Option::list_
OptionList * list_
The list in which this option is managed, if managed.
Definition:
Option.h:57
Wt::WText::setText
bool setText(const WString &text)
Option::addSeparator
void addSeparator()
Create and show the separator.
Definition:
Option.C:33
OptionList
A list of options, separated by '|'.
Definition:
OptionList.h:40
Option::setHidden
virtual void setHidden(bool hidden, const WAnimation &animation=WAnimation())
Definition:
Option.C:49
Wt::WString
Option::option_
WText * option_
The option command text.
Definition:
Option.h:51
OptionList::optionVisibilityChanged
void optionVisibilityChanged(Option *opt, bool hidden)
An option changed visibility: possibly update the separators inbetween.
Definition:
OptionList.C:38
Wt::WContainerWidget
Option::setText
void setText(const WString &text)
Change the text.
Definition:
Option.C:23
Option::sep_
WText * sep_
The separator '|'.
Definition:
Option.h:54
Wt::WWebWidget::setInline
virtual void setInline(bool isInline) override
Wt::WAnimation
Generated on Tue Dec 15 2020 for
the C++ Web Toolkit (Wt)
by
1.8.13