Move tinteger_selector_ to its own header.

This commit is contained in:
Mark de Wever 2008-11-27 17:41:18 +00:00
parent e129908df6
commit f92ec60b51
5 changed files with 55 additions and 30 deletions

View file

@ -16,6 +16,7 @@
#include "foreach.hpp"
#include "gui/dialogs/field.hpp"
#include "gui/widgets/integer_selector.hpp"
namespace gui2 {

View file

@ -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"

View file

@ -0,0 +1,52 @@
/* $Id$ */
/*
copyright (C) 2007 - 2008 by mark de wever <koraq@xs4all.nl>
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

View file

@ -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 {

View file

@ -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