]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CGUIScrollBar.h
Drop _IRR_COMPILE_WITH_GUI_
[irrlicht.git] / source / Irrlicht / CGUIScrollBar.h
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt\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 __C_GUI_SCROLL_BAR_H_INCLUDED__\r
6 #define __C_GUI_SCROLL_BAR_H_INCLUDED__\r
7 \r
8 #include "IrrCompileConfig.h"\r
9 #include "IGUIScrollBar.h"\r
10 #include "IGUIButton.h"\r
11 \r
12 namespace irr\r
13 {\r
14 namespace gui\r
15 {\r
16 \r
17         class CGUIScrollBar : public IGUIScrollBar\r
18         {\r
19         public:\r
20 \r
21                 //! constructor\r
22                 CGUIScrollBar(bool horizontal, IGUIEnvironment* environment,\r
23                         IGUIElement* parent, s32 id, core::rect<s32> rectangle,\r
24                         bool noclip=false);\r
25 \r
26                 //! destructor\r
27                 virtual ~CGUIScrollBar();\r
28 \r
29                 //! called if an event happened.\r
30                 bool OnEvent(const SEvent& event) override;\r
31 \r
32                 //! draws the element and its children\r
33                 void draw() override;\r
34 \r
35                 void OnPostRender(u32 timeMs) override;\r
36 \r
37 \r
38                 //! gets the maximum value of the scrollbar.\r
39                 s32 getMax() const override;\r
40 \r
41                 //! sets the maximum value of the scrollbar.\r
42                 void setMax(s32 max) override;\r
43 \r
44                 //! gets the minimum value of the scrollbar.\r
45                 s32 getMin() const override;\r
46 \r
47                 //! sets the minimum value of the scrollbar.\r
48                 void setMin(s32 min) override;\r
49 \r
50                 //! gets the small step value\r
51                 s32 getSmallStep() const override;\r
52 \r
53                 //! sets the small step value\r
54                 void setSmallStep(s32 step) override;\r
55 \r
56                 //! gets the large step value\r
57                 s32 getLargeStep() const override;\r
58 \r
59                 //! sets the large step value\r
60                 void setLargeStep(s32 step) override;\r
61 \r
62                 //! gets the current position of the scrollbar\r
63                 s32 getPos() const override;\r
64 \r
65                 //! sets the position of the scrollbar\r
66                 void setPos(s32 pos) override;\r
67 \r
68                 //! updates the rectangle\r
69                 void updateAbsolutePosition() override;\r
70 \r
71         private:\r
72 \r
73                 void refreshControls();\r
74                 s32 getPosFromMousePos(const core::position2di &p) const;\r
75 \r
76                 IGUIButton* UpButton;\r
77                 IGUIButton* DownButton;\r
78 \r
79                 core::rect<s32> SliderRect;\r
80 \r
81                 bool Dragging;\r
82                 bool Horizontal;\r
83                 bool DraggedBySlider;\r
84                 bool TrayClick;\r
85                 s32 Pos;\r
86                 s32 DrawPos;\r
87                 s32 DrawHeight;\r
88                 s32 Min;\r
89                 s32 Max;\r
90                 s32 SmallStep;\r
91                 s32 LargeStep;\r
92                 s32 DesiredPos;\r
93                 u32 LastChange;\r
94                 video::SColor CurrentIconColor;\r
95 \r
96                 f32 range () const { return (f32) ( Max - Min ); }\r
97         };\r
98 \r
99 } // end namespace gui\r
100 } // end namespace irr\r
101 \r
102 #endif\r