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
5 #ifndef __C_GUI_SCROLL_BAR_H_INCLUDED__
\r
6 #define __C_GUI_SCROLL_BAR_H_INCLUDED__
\r
8 #include "IrrCompileConfig.h"
\r
9 #ifdef _IRR_COMPILE_WITH_GUI_
\r
11 #include "IGUIScrollBar.h"
\r
12 #include "IGUIButton.h"
\r
19 class CGUIScrollBar : public IGUIScrollBar
\r
24 CGUIScrollBar(bool horizontal, IGUIEnvironment* environment,
\r
25 IGUIElement* parent, s32 id, core::rect<s32> rectangle,
\r
29 virtual ~CGUIScrollBar();
\r
31 //! called if an event happened.
\r
32 bool OnEvent(const SEvent& event) override;
\r
34 //! draws the element and its children
\r
35 void draw() override;
\r
37 void OnPostRender(u32 timeMs) override;
\r
40 //! gets the maximum value of the scrollbar.
\r
41 s32 getMax() const override;
\r
43 //! sets the maximum value of the scrollbar.
\r
44 void setMax(s32 max) override;
\r
46 //! gets the minimum value of the scrollbar.
\r
47 s32 getMin() const override;
\r
49 //! sets the minimum value of the scrollbar.
\r
50 void setMin(s32 min) override;
\r
52 //! gets the small step value
\r
53 s32 getSmallStep() const override;
\r
55 //! sets the small step value
\r
56 void setSmallStep(s32 step) override;
\r
58 //! gets the large step value
\r
59 s32 getLargeStep() const override;
\r
61 //! sets the large step value
\r
62 void setLargeStep(s32 step) override;
\r
64 //! gets the current position of the scrollbar
\r
65 s32 getPos() const override;
\r
67 //! sets the position of the scrollbar
\r
68 void setPos(s32 pos) override;
\r
70 //! updates the rectangle
\r
71 void updateAbsolutePosition() override;
\r
75 void refreshControls();
\r
76 s32 getPosFromMousePos(const core::position2di &p) const;
\r
78 IGUIButton* UpButton;
\r
79 IGUIButton* DownButton;
\r
81 core::rect<s32> SliderRect;
\r
85 bool DraggedBySlider;
\r
96 video::SColor CurrentIconColor;
\r
98 f32 range () const { return (f32) ( Max - Min ); }
\r
101 } // end namespace gui
\r
102 } // end namespace irr
\r
104 #endif // _IRR_COMPILE_WITH_GUI_
\r