From 2eef004b8b70861fd377ad50393a9a0ccbbbc152 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 21 Feb 2012 00:10:57 +0300 Subject: Move some settings from video to visual page. --- src/gui/widgets/setupitem.h | 51 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) (limited to 'src/gui/widgets/setupitem.h') 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 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 -- cgit v1.2.3-60-g2f50