diff --git a/src/gui/dialogs/dialog.cpp b/src/gui/dialogs/dialog.cpp index 27127ec6d95..fe003c233a4 100644 --- a/src/gui/dialogs/dialog.cpp +++ b/src/gui/dialogs/dialog.cpp @@ -16,6 +16,7 @@ #include "foreach.hpp" #include "gui/dialogs/field.hpp" +#include "gui/widgets/integer_selector.hpp" namespace gui2 { diff --git a/src/gui/dialogs/mp_create_game.cpp b/src/gui/dialogs/mp_create_game.cpp index 92e61f86d09..3a1afcf0488 100644 --- a/src/gui/dialogs/mp_create_game.cpp +++ b/src/gui/dialogs/mp_create_game.cpp @@ -19,6 +19,7 @@ #include "gettext.hpp" #include "gui/dialogs/field.hpp" #include "gui/dialogs/helper.hpp" +#include "gui/widgets/integer_selector.hpp" #include "gui/widgets/listbox.hpp" #include "gui/widgets/minimap.hpp" #include "../../settings.hpp" diff --git a/src/gui/widgets/integer_selector.hpp b/src/gui/widgets/integer_selector.hpp new file mode 100644 index 00000000000..c05e46db33e --- /dev/null +++ b/src/gui/widgets/integer_selector.hpp @@ -0,0 +1,52 @@ +/* $Id$ */ +/* + copyright (C) 2007 - 2008 by mark de wever + part of the battle for wesnoth project http://www.wesnoth.org/ + + this program is free software; you can redistribute it and/or modify + it under the terms of the gnu general public license version 2 + or at your option any later version. + this program is distributed in the hope that it will be useful, + but without any warranty. + + see the copying file for more details. +*/ + +#ifndef GUI_WIDGETS_INTEGER_SELECTOR_HPP_INCLUDED +#define GUI_WIDGETS_INTEGER_SELECTOR_HPP_INCLUDED + +namespace gui2 { + +/** + * Small abstract helper class. + * + * Parts of the engine inherit this class so we can have generic + * widgets to select an integer value. + */ +class tinteger_selector_ +{ +public: + virtual ~tinteger_selector_() {} + + /** Sets the selected value. */ + virtual void set_value(const int value) = 0; + + /** Gets the selected value. */ + virtual int get_value() const = 0; + + /** Sets the minimum value. */ + virtual void set_minimum_value(const int value) = 0; + + /** Gets the minimum value. */ + virtual int get_minimum_value() const = 0; + + /** Sets the maximum value. */ + virtual void set_maximum_value(const int value) = 0; + + /** Gets the maximum value. */ + virtual int get_maximum_value() const = 0; +}; + +} // namespace gui2 + +#endif diff --git a/src/gui/widgets/slider.hpp b/src/gui/widgets/slider.hpp index 691f58846d3..9d65b526205 100644 --- a/src/gui/widgets/slider.hpp +++ b/src/gui/widgets/slider.hpp @@ -15,6 +15,7 @@ #ifndef GUI_WIDGETS_SLIDER_HPP_INCLUDED #define GUI_WIDGETS_SLIDER_HPP_INCLUDED +#include "gui/widgets/integer_selector.hpp" #include "gui/widgets/scrollbar.hpp" namespace gui2 { diff --git a/src/gui/widgets/widget.hpp b/src/gui/widgets/widget.hpp index 8c3c3721c26..52b126fabb4 100644 --- a/src/gui/widgets/widget.hpp +++ b/src/gui/widgets/widget.hpp @@ -775,36 +775,6 @@ public: virtual void set_callback_state_change(void (*callback) (twidget*)) = 0; }; -/** - * Small abstract helper class. - * - * Parts of the engine inherit this class so we can have generic - * widgets to select an integer value. - */ -class tinteger_selector_ -{ -public: - virtual ~tinteger_selector_() {} - - /** Sets the selected value. */ - virtual void set_value(const int value) = 0; - - /** Gets the selected value. */ - virtual int get_value() const = 0; - - /** Sets the minimum value. */ - virtual void set_minimum_value(const int value) = 0; - - /** Gets the minimum value. */ - virtual int get_minimum_value() const = 0; - - /** Sets the maximum value. */ - virtual void set_maximum_value(const int value) = 0; - - /** Gets the maximum value. */ - virtual int get_maximum_value() const = 0; -}; - } // namespace gui2 #endif