Wt examples 4.8.1
Option.h
Go to the documentation of this file.
1// This may look like C code, but it's really -*- C++ -*-
2/*
3 * Copyright (C) 2008 Emweb bv, Herent, Belgium.
4 *
5 * See the LICENSE file for terms of use.
6 */
7#ifndef OPTION_H_
8#define OPTION_H_
9
10#include <Wt/WContainerWidget.h>
11#include <Wt/WText.h>
12
13using namespace Wt;
14
15class OptionList;
16
21
31class Option : public WContainerWidget
32{
33public:
36 Option(const WString& text);
37
40 void setText(const WString& text);
41
44 WInteractWidget *item() { return option_; }
45
46 virtual void setHidden(bool hidden,
47 const WAnimation& animation = WAnimation());
48
49private:
51 WText *option_;
52
54 WText *sep_;
55
58
59 friend class OptionList;
60
62
64 void addSeparator();
65
67 void showSeparator();
68
70 void hideSeparator();
71};
72
75#endif // OPTION_H_
A list of options, separated by '|'.
Definition: OptionList.h:41
A clickable option.
Definition: Option.h:32
WText * option_
The option command text.
Definition: Option.h:51
void setText(const WString &text)
Change the text.
Definition: Option.C:23
void setOptionList(OptionList *l)
Definition: Option.C:28
WText * sep_
The separator '|'.
Definition: Option.h:54
virtual void setHidden(bool hidden, const WAnimation &animation=WAnimation())
Definition: Option.C:49
OptionList * list_
The list in which this option is managed, if managed.
Definition: Option.h:57
void showSeparator()
Show the separator.
Definition: Option.C:44
WInteractWidget * item()
Returns the clickable part.
Definition: Option.h:44
void addSeparator()
Create and show the separator.
Definition: Option.C:33
void hideSeparator()
Hide the separator.
Definition: Option.C:39

Generated on Fri Sep 23 2022 for the C++ Web Toolkit (Wt) by doxygen 1.9.5