MyGUI 3.4.1
MyGUI_ScrollBar.h
Go to the documentation of this file.
1/*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7#ifndef MYGUI_SCROLL_BAR_H_
8#define MYGUI_SCROLL_BAR_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_Widget.h"
12
13namespace MyGUI
14{
15
16 class ControllerItem;
17
19
24 public Widget,
25 public MemberObsolete<ScrollBar>
26 {
28
29 public:
30 ScrollBar();
31
33 void setVerticalAlignment(bool _value);
35 bool getVerticalAlignment() const;
36
38 void setScrollRange(size_t _value);
40 size_t getScrollRange() const;
41
43 void setScrollPosition(size_t _value);
45 size_t getScrollPosition() const;
46
50 void setScrollPage(size_t _value);
52 size_t getScrollPage() const;
53
57 void setScrollViewPage(size_t _value);
59 size_t getScrollViewPage() const;
60
64 void setScrollWheelPage(size_t _value);
66 size_t getScrollWheelPage() const;
67
69 int getLineSize() const;
70
74 void setTrackSize(int _value);
76 int getTrackSize() const;
77
79 void setMinTrackSize(int _value);
81 int getMinTrackSize() const;
82
87 void setMoveToClick(bool _value);
89 bool getMoveToClick() const;
90
94 void setRepeatEnabled(bool enabled);
98 bool getRepeatEnabled() const;
99
101 void setRepeatTriggerTime(float time);
103 float getRepeatTriggerTime(float time) const;
104
106 void setRepeatStepTime(float time);
108 float getRepeatStepTime(float time) const;
109
111 void setPosition(const IntPoint& _value) override;
113 void setSize(const IntSize& _value) override;
115 void setCoord(const IntCoord& _value) override;
116
118 using Widget::setSize;
119 using Widget::setCoord;
120
121 /*events:*/
128
129 protected:
130 void initialiseOverride() override;
131 void shutdownOverride() override;
132
133 void updateTrack();
134 void TrackMove(int _left, int _top);
135
136 void onMouseWheel(int _rel) override;
137
138 void notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id);
139 void notifyMouseReleased(Widget* _sender, int _left, int _top, MouseButton _id);
140 void notifyMouseDrag(Widget* _sender, int _left, int _top, MouseButton _id);
141 void notifyMouseWheel(Widget* _sender, int _rel);
142
143 void setPropertyOverride(const std::string& _key, const std::string& _value) override;
144
145 int getTrackPlaceLength() const;
146
147 private:
148 void repeatClick(MyGUI::Widget* _widget, MyGUI::ControllerItem* _controller);
149 void widgetStartPressed();
150 void widgetEndPressed();
151 void widgetFirstPartPressed();
152 void widgetSecondPartPressed();
153
154 protected:
155 // наши кнопки
159 // куски между кнопками
162
163 // смещение внутри окна
165
166 // диапазон на который трек может двигаться
169
172 size_t mScrollPage; // track step, when clicking buttons
173 size_t mScrollViewPage; // track step, when clicking scroll line
174 size_t mScrollWheelPage; // track step, when scrolling with mouse wheel
175
176 bool mEnableRepeat; // Repeat clicks on the scrollbar buttons when the mouse button remains pressed down
177 float mRepeatTriggerTime; // Time the mouse button needs to be held for repeating to start
178 float mRepeatStepTime; // Time between repeats
179
182
184 };
185
186} // namespace MyGUI
187
188#endif // MYGUI_SCROLL_BAR_H_
#define MYGUI_EXPORT
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition: MyGUI_RTTI.h:48
widget description should be here.
Definition: MyGUI_Button.h:22
widget description should be here.
EventHandle_ScrollBarPtrSizeT eventScrollChangePosition
Widget * mWidgetFirstPart
Widget * mWidgetSecondPart
IntPoint mPreActionOffset
widget description should be here.
Definition: MyGUI_Widget.h:37
void setCoord(const IntCoord &_value) override
void setPosition(const IntPoint &_value) override
void setSize(const IntSize &_value) override
delegates::CMultiDelegate2< ScrollBar *, size_t > EventHandle_ScrollBarPtrSizeT