MyGUI: MyGUI_ScrollBar.h Source File

MyGUI 3.4.2

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

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
18 typedef delegates::CMultiDelegate2<ScrollBar*, size_t> EventHandle_ScrollBarPtrSizeT;
19
23 class MYGUI_EXPORT ScrollBar :
24 public Widget,
25 public MemberObsolete<ScrollBar>
26 {
27 MYGUI_RTTI_DERIVED( ScrollBar )
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
117 using Widget::setPosition;
118 using Widget::setSize;
119 using Widget::setCoord;
120
121 /*events:*/
127 EventHandle_ScrollBarPtrSizeT eventScrollChangePosition;
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 // наши кнопки
156 Button* mWidgetStart;
157 Button* mWidgetEnd;
158 Button* mWidgetTrack;
159 // куски между кнопками
160 Widget* mWidgetFirstPart;
161 Widget* mWidgetSecondPart;
162
163 // смещение внутри окна
164 IntPoint mPreActionOffset;
165
166 // диапазон на который трек может двигаться
167 size_t mSkinRangeStart;
168 size_t mSkinRangeEnd;
169
170 size_t mScrollRange;
171 size_t mScrollPosition;
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
180 int mMinTrackSize;
181 bool mMoveToClick;
182
183 bool mVerticalAlignment;
184 };
185
186} // namespace MyGUI
187
188#endif // MYGUI_SCROLL_BAR_H_
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition MyGUI_RTTI.h:48
MyGUI_Widget.h
MyGUI::Button
widget description should be here.
Definition MyGUI_Button.h:22
MyGUI::ControllerItem
Definition MyGUI_ControllerItem.h:27
MyGUI::MemberObsolete
Definition MyGUI_DeprecatedTypes.h:14
MyGUI::ScrollBar
widget description should be here.
Definition MyGUI_ScrollBar.h:26
MyGUI::ScrollBar::mScrollViewPage
size_t mScrollViewPage
Definition MyGUI_ScrollBar.h:173
MyGUI::ScrollBar::eventScrollChangePosition
EventHandle_ScrollBarPtrSizeT eventScrollChangePosition
Definition MyGUI_ScrollBar.h:127
MyGUI::ScrollBar::mMinTrackSize
int mMinTrackSize
Definition MyGUI_ScrollBar.h:180
MyGUI::ScrollBar::mScrollWheelPage
size_t mScrollWheelPage
Definition MyGUI_ScrollBar.h:174
MyGUI::ScrollBar::mWidgetFirstPart
Widget * mWidgetFirstPart
Definition MyGUI_ScrollBar.h:160
MyGUI::ScrollBar::mSkinRangeEnd
size_t mSkinRangeEnd
Definition MyGUI_ScrollBar.h:168
MyGUI::ScrollBar::mWidgetSecondPart
Widget * mWidgetSecondPart
Definition MyGUI_ScrollBar.h:161
MyGUI::ScrollBar::mScrollRange
size_t mScrollRange
Definition MyGUI_ScrollBar.h:170
MyGUI::ScrollBar::mScrollPage
size_t mScrollPage
Definition MyGUI_ScrollBar.h:172
MyGUI::ScrollBar::mVerticalAlignment
bool mVerticalAlignment
Definition MyGUI_ScrollBar.h:183
MyGUI::ScrollBar::mEnableRepeat
bool mEnableRepeat
Definition MyGUI_ScrollBar.h:176
MyGUI::ScrollBar::mWidgetStart
Button * mWidgetStart
Definition MyGUI_ScrollBar.h:156
MyGUI::ScrollBar::mMoveToClick
bool mMoveToClick
Definition MyGUI_ScrollBar.h:181
MyGUI::ScrollBar::mPreActionOffset
IntPoint mPreActionOffset
Definition MyGUI_ScrollBar.h:164
MyGUI::ScrollBar::mRepeatTriggerTime
float mRepeatTriggerTime
Definition MyGUI_ScrollBar.h:177
MyGUI::ScrollBar::mWidgetTrack
Button * mWidgetTrack
Definition MyGUI_ScrollBar.h:158
MyGUI::ScrollBar::mWidgetEnd
Button * mWidgetEnd
Definition MyGUI_ScrollBar.h:157
MyGUI::ScrollBar::mScrollPosition
size_t mScrollPosition
Definition MyGUI_ScrollBar.h:171
MyGUI::ScrollBar::mRepeatStepTime
float mRepeatStepTime
Definition MyGUI_ScrollBar.h:178
MyGUI::ScrollBar::mSkinRangeStart
size_t mSkinRangeStart
Definition MyGUI_ScrollBar.h:167
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:37
MyGUI::delegates::MultiDelegate
Definition MyGUI_Delegate.h:200
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::EventHandle_ScrollBarPtrSizeT
delegates::CMultiDelegate2< ScrollBar *, size_t > EventHandle_ScrollBarPtrSizeT
Definition MyGUI_ScrollBar.h:18
MyGUI::MouseButton
Definition MyGUI_MouseButton.h:16
MyGUI::types::TCoord< int >
MyGUI::types::TPoint< int >
MyGUI::types::TSize< int >