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 #include "IGUIScrollBar.h"
\r
10 #include "IGUIButton.h"
\r
17 class CGUIScrollBar : public IGUIScrollBar
\r
22 CGUIScrollBar(bool horizontal, IGUIEnvironment* environment,
\r
23 IGUIElement* parent, s32 id, core::rect<s32> rectangle,
\r
27 virtual ~CGUIScrollBar();
\r
29 //! called if an event happened.
\r
30 bool OnEvent(const SEvent& event) override;
\r
32 //! draws the element and its children
\r
33 void draw() override;
\r
35 void OnPostRender(u32 timeMs) override;
\r
38 //! gets the maximum value of the scrollbar.
\r
39 s32 getMax() const override;
\r
41 //! sets the maximum value of the scrollbar.
\r
42 void setMax(s32 max) override;
\r
44 //! gets the minimum value of the scrollbar.
\r
45 s32 getMin() const override;
\r
47 //! sets the minimum value of the scrollbar.
\r
48 void setMin(s32 min) override;
\r
50 //! gets the small step value
\r
51 s32 getSmallStep() const override;
\r
53 //! sets the small step value
\r
54 void setSmallStep(s32 step) override;
\r
56 //! gets the large step value
\r
57 s32 getLargeStep() const override;
\r
59 //! sets the large step value
\r
60 void setLargeStep(s32 step) override;
\r
62 //! gets the current position of the scrollbar
\r
63 s32 getPos() const override;
\r
65 //! sets the position of the scrollbar
\r
66 void setPos(s32 pos) override;
\r
68 //! updates the rectangle
\r
69 void updateAbsolutePosition() override;
\r
73 void refreshControls();
\r
74 s32 getPosFromMousePos(const core::position2di &p) const;
\r
76 IGUIButton* UpButton;
\r
77 IGUIButton* DownButton;
\r
79 core::rect<s32> SliderRect;
\r
83 bool DraggedBySlider;
\r
94 video::SColor CurrentIconColor;
\r
96 f32 range () const { return (f32) ( Max - Min ); }
\r
99 } // end namespace gui
\r
100 } // end namespace irr
\r