aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/source/Irrlicht/CGUISpinBox.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2016-03-28 22:28:34 +1000
committerDavid Walter Seikel2016-03-28 22:28:34 +1000
commit7028cbe09c688437910a25623098762bf0fa592d (patch)
tree10b5af58277d9880380c2251f109325542c4e6eb /src/others/irrlicht-1.8.1/source/Irrlicht/CGUISpinBox.h
parentMove lemon to the src/others directory. (diff)
downloadSledjHamr-7028cbe09c688437910a25623098762bf0fa592d.zip
SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.tar.gz
SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.tar.bz2
SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.tar.xz
Move Irrlicht to src/others.
Diffstat (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/CGUISpinBox.h')
-rw-r--r--src/others/irrlicht-1.8.1/source/Irrlicht/CGUISpinBox.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/CGUISpinBox.h b/src/others/irrlicht-1.8.1/source/Irrlicht/CGUISpinBox.h
new file mode 100644
index 0000000..e487c0b
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/source/Irrlicht/CGUISpinBox.h
@@ -0,0 +1,108 @@
1// Copyright (C) 2006-2012 Michael Zeilfelder
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __C_GUI_SPIN_BOX_H_INCLUDED__
6#define __C_GUI_SPIN_BOX_H_INCLUDED__
7
8#include "IrrCompileConfig.h"
9#ifdef _IRR_COMPILE_WITH_GUI_
10
11#include "IGUISpinBox.h"
12
13namespace irr
14{
15namespace gui
16{
17 class IGUIEditBox;
18 class IGUIButton;
19
20 class CGUISpinBox : public IGUISpinBox
21 {
22 public:
23
24 //! constructor
25 CGUISpinBox(const wchar_t* text, bool border, IGUIEnvironment* environment,
26 IGUIElement* parent, s32 id, const core::rect<s32>& rectangle);
27
28 //! destructor
29 virtual ~CGUISpinBox();
30
31 //! Access the edit box used in the spin control
32 /** \param enable: If set to true, the override color, which can be set
33 with IGUIEditBox::setOverrideColor is used, otherwise the
34 EGDC_BUTTON_TEXT color of the skin. */
35 virtual IGUIEditBox* getEditBox() const;
36
37 //! set the current value of the spinbox
38 /** \param val: value to be set in the spinbox */
39 virtual void setValue(f32 val);
40
41 //! Get the current value of the spinbox
42 virtual f32 getValue() const;
43
44 //! set the range of values which can be used in the spinbox
45 /** \param min: minimum value
46 \param max: maximum value */
47 virtual void setRange(f32 min, f32 max);
48
49 //! get the minimum value which can be used in the spinbox
50 virtual f32 getMin() const;
51
52 //! get the maximum value which can be used in the spinbox
53 virtual f32 getMax() const;
54
55 //! step size by which values are changed when pressing the spin buttons
56 /** \param step: stepsize used for value changes when pressing spin buttons */
57 virtual void setStepSize(f32 step=1.f);
58
59 //! returns the step size
60 virtual f32 getStepSize() const;
61
62 //! called if an event happened.
63 virtual bool OnEvent(const SEvent& event);
64
65 //! Draws the element and its children.
66 virtual void draw();
67
68 //! Sets the new caption of the element
69 virtual void setText(const wchar_t* text);
70
71 //! Returns caption of this element.
72 virtual const wchar_t* getText() const;
73
74 //! Sets the number of decimal places to display.
75 //! Note that this also rounds the range to the same number of decimal places.
76 /** \param places: The number of decimal places to display, use -1 to reset */
77 virtual void setDecimalPlaces(s32 places);
78
79 //! Writes attributes of the element.
80 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
81
82 //! Reads attributes of the element
83 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
84
85 protected:
86 virtual void verifyValueRange();
87 void refreshSprites();
88
89 IGUIEditBox * EditBox;
90 IGUIButton * ButtonSpinUp;
91 IGUIButton * ButtonSpinDown;
92 video::SColor CurrentIconColor;
93 f32 StepSize;
94 f32 RangeMin;
95 f32 RangeMax;
96
97 core::stringw FormatString;
98 s32 DecimalPlaces;
99 };
100
101
102} // end namespace gui
103} // end namespace irr
104
105#endif // _IRR_COMPILE_WITH_GUI_
106
107#endif // __C_GUI_SPIN_BOX_H_INCLUDED__
108