Wt examples  3.2.0
Public Member Functions | Private Member Functions | Private Attributes | Friends
Option Class Reference

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.

  : WContainerWidget(parent),
    sep_(0),
    list_(0)
{
  setInline(true);

  option_ = new WText(text, this);
  option_->setStyleClass("option");
}

Member Function Documentation

void Option::addSeparator ( ) [private]

Create and show the separator.

Definition at line 33 of file Option.C.

{
  sep_ = new WText("|", this);
  sep_->setStyleClass("sep");
}
void Option::hideSeparator ( ) [private]

Hide the separator.

Definition at line 39 of file Option.C.

{
  sep_->hide();
}
WInteractWidget* Option::item ( ) [inline]

Returns the clickable part.

Definition at line 44 of file Option.h.

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

Definition at line 49 of file Option.C.

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

Definition at line 28 of file Option.C.

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

Change the text.

Definition at line 23 of file Option.C.

{
  option_->setText(text);
}
void Option::showSeparator ( ) [private]

Show the separator.

Definition at line 44 of file Option.C.

{
  sep_->show();
}

Friends And Related Function Documentation

friend class OptionList [friend]

Definition at line 58 of file Option.h.


Member Data Documentation

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 Tue Nov 29 2011 for the C++ Web Toolkit (Wt) by doxygen 1.7.5.1