Wt examples  3.3.0
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Option Class Reference

A clickable option. More...

#include <Option.h>

Inheritance diagram for Option:
Inheritance graph
[legend]

Public Member Functions

 Option (const WString &text, WContainerWidget *parent=0)
 Create an Option with the given text. More...
 
void setText (const WString &text)
 Change the text. More...
 
WInteractWidgetitem ()
 Returns the clickable part. More...
 
virtual void setHidden (bool)
 

Private Member Functions

void setOptionList (OptionList *l)
 
void addSeparator ()
 Create and show the separator. More...
 
void showSeparator ()
 Show the separator. More...
 
void hideSeparator ()
 Hide the separator. More...
 

Private Attributes

WTextoption_
 The option command text. More...
 
WTextsep_
 The separator '|'. More...
 
OptionListlist_
 The list in which this option is managed, if managed. More...
 

Friends

class OptionList
 

Additional Inherited Members

- Protected Member Functions inherited from Wt::WWidget
virtual void enableAjax ()=0
 
virtual void propagateSetEnabled (bool enabled)=0
 
virtual void render (WFlags< RenderFlag > flags)
 

Detailed Description

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.

Constructor & Destructor Documentation

Option::Option ( const WString text,
WContainerWidget parent = 0 
)

Create an Option with the given text.

Definition at line 12 of file Option.C.

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 }

Member Function Documentation

void Option::addSeparator ( )
private

Create and show the separator.

Definition at line 33 of file Option.C.

34 {
35  sep_ = new WText("|", this);
36  sep_->setStyleClass("sep");
37 }
void Option::hideSeparator ( )
private

Hide the separator.

Definition at line 39 of file Option.C.

40 {
41  sep_->hide();
42 }
WInteractWidget* Option::item ( )
inline

Returns the clickable part.

Definition at line 44 of file Option.h.

44 { return option_; }
void Option::setHidden ( bool  hidden)
virtual

Definition at line 49 of file Option.C.

50 {
51  WContainerWidget::setHidden(hidden);
52 
53  if (list_)
54  list_->optionVisibilityChanged(this, hidden);
55 }
void Option::setOptionList ( OptionList l)
private

Definition at line 28 of file Option.C.

29 {
30  list_ = l;
31 }
void Option::setText ( const WString text)

Change the text.

Definition at line 23 of file Option.C.

24 {
25  option_->setText(text);
26 }
void Option::showSeparator ( )
private

Show the separator.

Definition at line 44 of file Option.C.

45 {
46  sep_->show();
47 }

Friends And Related Function Documentation

friend class OptionList
friend

Definition at line 58 of file Option.h.

Member Data Documentation

OptionList* Option::list_
private

The list in which this option is managed, if managed.

Definition at line 56 of file Option.h.

WText* Option::option_
private

The option command text.

Definition at line 50 of file Option.h.

WText* Option::sep_
private

The separator '|'.

Definition at line 53 of file Option.h.


The documentation for this class was generated from the following files:

Generated on Fri May 31 2013 for the C++ Web Toolkit (Wt) by doxygen 1.8.3.1