Wt examples: /home/koen/project/wt/public-git/wt/examples/composer/Option.C Source File

Wt examples 3.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

/home/koen/project/wt/public-git/wt/examples/composer/Option.C
Go to the documentation of this file.

    00001 /*
    00002  * Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
    00003  *
    00004  * See the LICENSE file for terms of use.
    00005  */
    00006
    00007 #include <Wt/WText>
    00008
    00009 #include "Option.h"
    00010 #include "OptionList.h"
    00011
    00012 Option::Option(const WString& text, WContainerWidget *parent)
    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 }
    00022
    00023 void Option::setText(const WString& text)
    00024 {
    00025   option_->setText(text);
    00026 }
    00027
    00028 void Option::setOptionList(OptionList *l)
    00029 {
    00030   list_ = l;
    00031 }
    00032
    00033 void Option::addSeparator()
    00034 {
    00035   sep_ = new WText("|", this);
    00036   sep_->setStyleClass("sep");
    00037 }
    00038
    00039 void Option::hideSeparator()
    00040 {
    00041   sep_->hide();
    00042 }
    00043
    00044 void Option::showSeparator()
    00045 {
    00046   sep_->show();
    00047 }
    00048
    00049 void Option::setHidden(bool hidden)
    00050 {
    00051   WContainerWidget::setHidden(hidden);
    00052
    00053   if (list_)
    00054     list_->optionVisibilityChanged(this, hidden);
    00055 }