From d5eb424dcd214b4646a960e04b9271e70b096856 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 3 Jul 2011 17:23:05 +0300 Subject: Add separator field to setup settings tabs. --- src/gui/setupitem.cpp | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'src/gui/setupitem.cpp') diff --git a/src/gui/setupitem.cpp b/src/gui/setupitem.cpp index ecd6a9407..e41e9357d 100644 --- a/src/gui/setupitem.cpp +++ b/src/gui/setupitem.cpp @@ -111,6 +111,8 @@ void SetupItem::load() case VINT: mValue = toString(cfg->getIntValue(mKeyName)); break; + case VNONE: + break; } } } @@ -451,3 +453,55 @@ void SetupItemIntTextField::apply(std::string eventName) fromWidget(); save(); } + +SetupItemLabel::SetupItemLabel(std::string text, std::string description, + SetupTabScroll *parent, bool separator) : + SetupItem(text, description, "", parent, "", "", true), + mLabel(0), + mIsSeparator(separator) +{ + mValueType = VNONE; + createControls(); +} + +SetupItemLabel::~SetupItemLabel() +{ + mWidget = 0; + mLabel = 0; +} + +void SetupItemLabel::createControls() +{ + if (mIsSeparator) + { + const std::string str = " \342\200\225\342\200\225\342\200\225" + "\342\200\225\342\200\225 "; + mLabel = new Label(str + mText + str); + } + else + { + mLabel = new Label(mText); + } + + mWidget = mLabel; + mParent->getContainer()->add(mWidget); + mParent->addControl(this); + mParent->addActionListener(this); + mWidget->addActionListener(this); +} + +void SetupItemLabel::fromWidget() +{ +} + +void SetupItemLabel::toWidget() +{ +} + +void SetupItemLabel::action(const gcn::ActionEvent &event) +{ +} + +void SetupItemLabel::apply(std::string eventName) +{ +} -- cgit v1.2.3-70-g09d2