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 "IGUIScrollBar.h"
\r
9 #include "IGUIButton.h"
\r
16 class CGUIScrollBar : public IGUIScrollBar
\r
21 CGUIScrollBar(bool horizontal, IGUIEnvironment* environment,
\r
22 IGUIElement* parent, s32 id, core::rect<s32> rectangle,
\r
26 virtual ~CGUIScrollBar();
\r
28 //! called if an event happened.
\r
29 bool OnEvent(const SEvent& event) override;
\r
31 //! draws the element and its children
\r
32 void draw() override;
\r
34 void OnPostRender(u32 timeMs) override;
\r
37 //! gets the maximum value of the scrollbar.
\r
38 s32 getMax() const override;
\r
40 //! sets the maximum value of the scrollbar.
\r
41 void setMax(s32 max) override;
\r
43 //! gets the minimum value of the scrollbar.
\r
44 s32 getMin() const override;
\r
46 //! sets the minimum value of the scrollbar.
\r
47 void setMin(s32 min) override;
\r
49 //! gets the small step value
\r
50 s32 getSmallStep() const override;
\r
52 //! sets the small step value
\r
53 void setSmallStep(s32 step) override;
\r
55 //! gets the large step value
\r
56 s32 getLargeStep() const override;
\r
58 //! sets the large step value
\r
59 void setLargeStep(s32 step) override;
\r
61 //! gets the current position of the scrollbar
\r
62 s32 getPos() const override;
\r
64 //! sets the position of the scrollbar
\r
65 void setPos(s32 pos) override;
\r
67 //! updates the rectangle
\r
68 void updateAbsolutePosition() override;
\r
72 void refreshControls();
\r
73 s32 getPosFromMousePos(const core::position2di &p) const;
\r
75 IGUIButton* UpButton;
\r
76 IGUIButton* DownButton;
\r
78 core::rect<s32> SliderRect;
\r
82 bool DraggedBySlider;
\r
93 video::SColor CurrentIconColor;
\r
95 f32 range () const { return (f32) ( Max - Min ); }
\r
98 } // end namespace gui
\r
99 } // end namespace irr
\r