summaryrefslogtreecommitdiff
path: root/src/gui/widgets/setupitem.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-21 00:10:57 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-21 01:03:28 +0300
commit2eef004b8b70861fd377ad50393a9a0ccbbbc152 (patch)
tree55e8350d51756c3da3dca5186e6f54826fa8482d /src/gui/widgets/setupitem.h
parentf9abb45a7776fa158daef508f8287da267de002b (diff)
downloadmanaverse-2eef004b8b70861fd377ad50393a9a0ccbbbc152.tar.gz
manaverse-2eef004b8b70861fd377ad50393a9a0ccbbbc152.tar.bz2
manaverse-2eef004b8b70861fd377ad50393a9a0ccbbbc152.tar.xz
manaverse-2eef004b8b70861fd377ad50393a9a0ccbbbc152.zip
Move some settings from video to visual page.
Diffstat (limited to 'src/gui/widgets/setupitem.h')
-rw-r--r--src/gui/widgets/setupitem.h51
1 files changed, 50 insertions, 1 deletions
diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h
index 220a55494..cf847f55d 100644
--- a/src/gui/widgets/setupitem.h
+++ b/src/gui/widgets/setupitem.h
@@ -92,7 +92,6 @@ class SetupItem : public gcn::ActionListener
virtual void cancel(std::string eventName);
virtual void externalUpdated(std::string eventName);
-// virtual int add(ContainerPlacer &place, int x, int y, int width);
bool isMainConfig() const
{ return mMainConfig; }
@@ -290,6 +289,8 @@ class SetupItemSlider : public SetupItem
void apply(std::string eventName);
+ void updateLabel();
+
protected:
HorizontContainer *mHorizont;
Label *mLabel;
@@ -298,4 +299,52 @@ class SetupItemSlider : public SetupItem
double mMax;
};
+typedef std::vector<std::string> SetupItemNames;
+typedef SetupItemNames::iterator SetupItemNamesIter;
+typedef SetupItemNames::const_iterator SetupItemNamesConstIter;
+
+class SetupItemSlider2 : public SetupItem
+{
+ public:
+ SetupItemSlider2(std::string text, std::string description,
+ std::string keyName, SetupTabScroll *parent,
+ std::string eventName, int min, int max,
+ SetupItemNames *values, bool mainConfig = true);
+
+ SetupItemSlider2(std::string text, std::string description,
+ std::string keyName, SetupTabScroll *parent,
+ std::string eventName, int min, int max,
+ SetupItemNames *values, std::string def,
+ bool mainConfig = true);
+
+ ~SetupItemSlider2();
+
+ void createControls();
+
+ void fromWidget();
+
+ void toWidget();
+
+ void action(const gcn::ActionEvent &event);
+
+ void apply(std::string eventName);
+
+ void setInvertValue(int v);
+
+ protected:
+ void updateLabel();
+
+ int getMaxWidth();
+
+ HorizontContainer *mHorizont;
+ Label *mLabel;
+ Label *mLabel2;
+ Slider *mSlider;
+ SetupItemNames *mValues;
+ int mMin;
+ int mMax;
+ bool mInvert;
+ int mInvertValue;
+};
+
#endif