Option Class Reference
[Composer example]

A clickable option. More...

#include <Option.h>

Inheritance diagram for Option:

Inheritance graph
[legend]

List of all members.

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

Friends

class OptionList


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.

00013   : WContainerWidget(parent),
00014     sep_(0),
00015     list_(0)
00016 {
00017   setInline(true);
00018 
00019   option_ = new WText(text, this);
00020   option_->setStyleClass("option");
00021 }


Member Function Documentation

void Option::setText ( const WString text  ) 

Change the text.

Definition at line 23 of file Option.C.

00024 {
00025   option_->setText(text);
00026 }

WInteractWidget* Option::item (  )  [inline]

Returns the clickable part.

Definition at line 44 of file Option.h.

00044 { return option_; }

void Option::setHidden ( bool  hidden  )  [virtual]

Reimplemented from Wt::WWebWidget.

Definition at line 49 of file Option.C.

00050 {
00051   WContainerWidget::setHidden(hidden);
00052 
00053   if (list_)
00054     list_->optionVisibilityChanged(this, hidden);
00055 }

void Option::setOptionList ( OptionList l  )  [private]

Definition at line 28 of file Option.C.

00029 {
00030   list_ = l;
00031 }

void Option::addSeparator (  )  [private]

Create and show the separator.

Definition at line 33 of file Option.C.

00034 {
00035   sep_ = new WText("|", this);
00036   sep_->setStyleClass("sep");
00037 }

void Option::showSeparator (  )  [private]

Show the separator.

Definition at line 44 of file Option.C.

00045 {
00046   sep_->show();
00047 }

void Option::hideSeparator (  )  [private]

Hide the separator.

Definition at line 39 of file Option.C.

00040 {
00041   sep_->hide();
00042 }


Friends And Related Function Documentation

friend class OptionList [friend]

Definition at line 58 of file Option.h.


Member Data Documentation

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 list in which this option is managed, if managed.

Definition at line 56 of file Option.h.


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

Generated on Mon Mar 9 08:28:56 2009 for Wt by doxygen 1.5.6