/home/koen/project/wt/cvs/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 <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   option_ = new WText(text, this);
00019   option_->setStyleClass("option");
00020 }
00021 
00022 void Option::setText(const WString& text)
00023 {
00024   option_->setText(text);
00025 }
00026 
00027 void Option::setOptionList(OptionList *l)
00028 {
00029   list_ = l;
00030 }
00031 
00032 void Option::addSeparator()
00033 {
00034   sep_ = new WText("|", this);
00035   sep_->setStyleClass("sep");
00036 }
00037 
00038 void Option::hideSeparator()
00039 {
00040   sep_->hide();
00041 }
00042 
00043 void Option::showSeparator()
00044 {
00045   sep_->show();
00046 }
00047 
00048 void Option::setHidden(bool hidden)
00049 {
00050   WContainerWidget::setHidden(hidden);
00051 
00052   if (list_)
00053     list_->optionVisibilityChanged(this, hidden);
00054 }

Generated on Mon Apr 14 15:15:04 2008 for Wt by doxygen 1.5.3