20 #ifndef HEADER_SPINNER_HPP
21 #define HEADER_SPINNER_HPP
23 #include <irrString.h>
27 namespace video {
class ITexture; }
28 namespace gui {
class IGUIImage; }
31 #include "guiengine/widget.hpp"
32 #include "utils/leak_check.hpp"
33 #include "utils/ptr_vector.hpp"
59 std::function<void(
SpinnerWidget* spinner)> m_value_updated_callback;
62 int m_value, m_min, m_max;
66 irr::gui::IGUIImage* m_red_mark_widget;
68 int m_spinner_widget_player_id;
69 bool m_use_background_color;
106 const std::string& originator,
110 virtual EventPropagation
rightPressed(
const int playerID);
113 virtual EventPropagation
leftPressed(
const int playerID);
137 void addLabel(irr::core::stringw label);
141 void setUseBackgroundColor() { m_use_background_color=
true; }
142 bool getUseBackgroundColor()
const {
return m_use_background_color; }
143 void setSpinnerWidgetPlayerID(
int playerID) { m_spinner_widget_player_id=playerID; }
144 int getSpinnerWidgetPlayerID()
const {
return m_spinner_widget_player_id; }
145 void unsetUseBackgroundColor() { m_use_background_color=
false; }
147 void activateSelectedButton();
148 void setSelectedButton(
bool right)
166 bool isButtonSelected(
bool right)
175 void setListener(ISpinnerConfirmListener* listener) { m_listener = listener; }
197 void setValue(irr::core::stringw new_value);
280 core::rect<s32> getLeftArrow()
const {
return m_left_arrow; }
291 virtual void setActive(
bool active =
true);
295 const core::stringw& getCustomText()
const {
return m_custom_text; }
298 void setRange(
float min,
float max,
float step);
299 void setRange(
int min,
int max) { setRange(min, max, 1.0); }
301 void onPressed(
int x,
int y);
302 void doValueUpdatedCallback()
304 if (m_value_updated_callback)
305 m_value_updated_callback(
this);
307 void setValueUpdatedCallback(
308 std::function<
void(SpinnerWidget* spinner)> callback)
310 m_value_updated_callback = callback;
315 m_red_mark_widget = NULL;
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:33