MyGUI 3.2.0

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

- File List
- Globals

MyGUI_ScrollBar.h
Go to the documentation of this file.
1
6 /*
7 This file is part of MyGUI.
8
9 MyGUI is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 MyGUI is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_SCROLL_BAR_H__
23 #define __MYGUI_SCROLL_BAR_H__
24
25 #include "MyGUI_Prerequest.h"
26 #include "MyGUI_Widget.h"
27
28 namespace MyGUI
29 {
30
31 typedef delegates::CMultiDelegate2<ScrollBar*, size_t> EventHandle_ScrollBarPtrSizeT;
32
33 class MYGUI_EXPORT ScrollBar :
34 public Widget,
35 public MemberObsolete<ScrollBar>
36 {
37 MYGUI_RTTI_DERIVED( ScrollBar )
38
39 public:
40 ScrollBar();
41
43 void setVerticalAlignment(bool _value);
45 bool getVerticalAlignment() const;
46
48 void setScrollRange(size_t _value);
50 size_t getScrollRange() const;
51
53 void setScrollPosition(size_t _value);
55 size_t getScrollPosition() const;
56
60 void setScrollPage(size_t _value);
62 size_t getScrollPage() const;
63
67 void setScrollViewPage(size_t _value);
69 size_t getScrollViewPage() const;
70
72 int getLineSize() const;
73
77 void setTrackSize(int _value);
79 int getTrackSize() const;
80
82 void setMinTrackSize(int _value);
84 int getMinTrackSize() const;
85
90 void setMoveToClick(bool _value);
92 bool getMoveToClick() const;
93
95 virtual void setPosition(const IntPoint& _value);
97 virtual void setSize(const IntSize& _value);
99 virtual void setCoord(const IntCoord& _value);
100
102 void setPosition(int _left, int _top);
104 void setSize(int _width, int _height);
106 void setCoord(int _left, int _top, int _width, int _height);
107
108 /*events:*/
114 EventHandle_ScrollBarPtrSizeT
115 eventScrollChangePosition;
116
117 protected:
118 virtual void initialiseOverride();
119 virtual void shutdownOverride();
120
121 void updateTrack();
122 void TrackMove(int _left, int _top);
123
124 virtual void onMouseWheel(int _rel);
125
126 void notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id);
127 void notifyMouseReleased(Widget* _sender, int _left, int _top, MouseButton _id);
128 void notifyMouseDrag(Widget* _sender, int _left, int _top, MouseButton _id);
129 void notifyMouseWheel(Widget* _sender, int _rel);
130
131 virtual void setPropertyOverride(const std::string& _key, const std::string& _value);
132
133 int getTrackPlaceLength() const;
134
135 protected:
136 // наши кнопки
137 Button* mWidgetStart;
138 Button* mWidgetEnd;
139 Button* mWidgetTrack;
140 // куски между кнопками
141 Widget* mWidgetFirstPart;
142 Widget* mWidgetSecondPart;
143
144 // смещение внутри окна
145 IntPoint mPreActionOffset;
146
147 // диапазон на который трек может двигаться
148 size_t mSkinRangeStart;
149 size_t mSkinRangeEnd;
150
151 size_t mScrollRange;
152 size_t mScrollPosition;
153 size_t mScrollPage; // на сколько перещелкивать, при щелчке на кнопке
154 size_t mScrollViewPage; // на сколько перещелкивать, при щелчке по полосе
155
156 int mMinTrackSize;
157 bool mMoveToClick;
158
159 bool mVerticalAlignment;
160 };
161
162 } // namespace MyGUI
163
164 #endif // __MYGUI_SCROLL_BAR_H__
MyGUI::types::TCoord< int >
MyGUI::Widget
Definition: MyGUI_Widget.h:41
MyGUI::types::TPoint< int >
MyGUI_Prerequest.h
MyGUI::types::TSize< int >
MyGUI::MouseButton
Definition: MyGUI_MouseButton.h:30
MyGUI::Button
Definition: MyGUI_Button.h:31
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition: MyGUI_RTTI.h:88
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:120
MyGUI::delegates::CMultiDelegate2< ScrollBar *, size_t >
MyGUI_Widget.h
MyGUI::MemberObsolete
Definition: MyGUI_DeprecatedTypes.h:28
MyGUI::EventHandle_ScrollBarPtrSizeT
delegates::CMultiDelegate2< ScrollBar *, size_t > EventHandle_ScrollBarPtrSizeT
Definition: MyGUI_ScrollBar.h:31
MyGUI::ScrollBar
Definition: MyGUI_ScrollBar.h:33