]> git.lizzy.rs Git - irrlicht.git/blob - include/IGUISpinBox.h
Readd TGA format support (#64)
[irrlicht.git] / include / IGUISpinBox.h
1 // Copyright (C) 2006-2012 Michael Zeilfelder\r
2 // This file is part of the "Irrlicht Engine".\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
4 \r
5 #ifndef __I_GUI_SPIN_BOX_H_INCLUDED__\r
6 #define __I_GUI_SPIN_BOX_H_INCLUDED__\r
7 \r
8 #include "IGUIElement.h"\r
9 \r
10 namespace irr\r
11 {\r
12 namespace gui\r
13 {\r
14         class IGUIEditBox;\r
15 \r
16         //! Enumeration bitflag for when to validate the text typed into the spinbox\r
17         //! Default used by Irrlicht is: (EGUI_SBV_ENTER|EGUI_SBV_LOSE_FOCUS)\r
18         enum EGUI_SPINBOX_VALIDATION\r
19         {\r
20                 //! Does not validate typed text, probably a bad idea setting this usually.\r
21                 EGUI_SBV_NEVER  = 0,\r
22                 //! Validate on each change. Was default up to Irrlicht 1.8\r
23                 EGUI_SBV_CHANGE = 1,\r
24                 //! Validate when enter was pressed\r
25                 EGUI_SBV_ENTER = 2,\r
26                 //! Validate when the editbox loses the focus\r
27                 EGUI_SBV_LOSE_FOCUS = 4\r
28         };\r
29 \r
30 \r
31         //! Single line edit box + spin buttons\r
32         /** \par This element can create the following events of type EGUI_EVENT_TYPE:\r
33         \li EGET_SPINBOX_CHANGED\r
34         */\r
35         class IGUISpinBox : public IGUIElement\r
36         {\r
37         public:\r
38 \r
39                 //! constructor\r
40                 IGUISpinBox(IGUIEnvironment* environment, IGUIElement* parent,\r
41                                         s32 id, core::rect<s32> rectangle)\r
42                         : IGUIElement(EGUIET_SPIN_BOX, environment, parent, id, rectangle) {}\r
43 \r
44                 //! Access the edit box used in the spin control\r
45                 virtual IGUIEditBox* getEditBox() const = 0;\r
46 \r
47                 //! set the current value of the spinbox\r
48                 /** \param val: value to be set in the spinbox */\r
49                 virtual void setValue(f32 val) = 0;\r
50 \r
51                 //! Get the current value of the spinbox\r
52                 virtual f32 getValue() const = 0;\r
53 \r
54                 //! set the range of values which can be used in the spinbox\r
55                 /** \param min: minimum value\r
56                 \param max: maximum value */\r
57                 virtual void setRange(f32 min, f32 max) = 0;\r
58 \r
59                 //! get the minimum value which can be used in the spinbox\r
60                 virtual f32 getMin() const = 0;\r
61 \r
62                 //! get the maximum value which can be used in the spinbox\r
63                 virtual f32 getMax() const = 0;\r
64 \r
65                 //! Step size by which values are changed when pressing the spinbuttons\r
66                 /** The step size also determines the number of decimal places to display\r
67                 \param step: stepsize used for value changes when pressing spinbuttons */\r
68                 virtual void setStepSize(f32 step=1.f) = 0;\r
69 \r
70                 //! Sets the number of decimal places to display.\r
71                 //! Note that this also rounds the range to the same number of decimal places.\r
72                 /** \param places: The number of decimal places to display, use -1 to reset */\r
73                 virtual void setDecimalPlaces(s32 places) = 0;\r
74 \r
75                 //! get the current step size\r
76                 virtual f32 getStepSize() const = 0;\r
77 \r
78                 //! Sets when the spinbox has to validate entered text.\r
79                 /** \param validateOn Can be any combination of EGUI_SPINBOX_VALIDATION bit flags */\r
80                 virtual void setValidateOn(u32 validateOn) = 0;\r
81 \r
82                 //! Gets when the spinbox has to validate entered text.\r
83                 /** \return A combination of EGUI_SPINBOX_VALIDATION bit flags */\r
84                 virtual u32 getValidateOn() const = 0;\r
85         };\r
86 \r
87 \r
88 } // end namespace gui\r
89 } // end namespace irr\r
90 \r
91 #endif // __I_GUI_SPIN_BOX_H_INCLUDED__\r
92 \r