2 Copyright (C) 2002-2013 Nikolaus Gebhardt
3 This file is part of the "Irrlicht Engine".
4 For conditions of distribution and use, see copyright notice in irrlicht.h
6 Modified 2019.05.01 by stujones11, Stuart Jones <stujones111@gmail.com>
8 This is a heavily modified copy of the Irrlicht CGUIScrollBar class
9 which includes automatic scaling of the thumb slider and hiding of
10 the arrow buttons where there is insufficient space.
15 #include "irrlichttypes_extrabloated.h"
20 class GUIScrollBar : public IGUIElement
23 GUIScrollBar(IGUIEnvironment *environment, IGUIElement *parent, s32 id,
24 core::rect<s32> rectangle, bool horizontal, bool auto_scale);
34 virtual void updateAbsolutePosition();
35 virtual bool OnEvent(const SEvent &event);
37 s32 getMax() const { return max_pos; }
38 s32 getMin() const { return min_pos; }
39 s32 getLargeStep() const { return large_step; }
40 s32 getSmallStep() const { return small_step; }
43 void setMax(const s32 &max);
44 void setMin(const s32 &min);
45 void setSmallStep(const s32 &step);
46 void setLargeStep(const s32 &step);
47 void setPos(const s32 &pos);
48 void setPageSize(const s32 &size);
49 void setArrowsVisible(ArrowVisibility visible);
52 void refreshControls();
53 s32 getPosFromMousePos(const core::position2di &p) const;
54 f32 range() const { return f32(max_pos - min_pos); }
56 IGUIButton *up_button;
57 IGUIButton *down_button;
58 ArrowVisibility arrow_visibility = DEFAULT;
62 bool dragged_by_slider;
76 core::rect<s32> slider_rect;
77 video::SColor current_icon_color;