MyGUI  3.0.1
MyGUI_VScroll.h
Go to the documentation of this file.
1 
7 /*
8  This file is part of MyGUI.
9 
10  MyGUI is free software: you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  MyGUI is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
22 */
23 #ifndef __MYGUI_VSCROLL_H__
24 #define __MYGUI_VSCROLL_H__
25 
26 #include "MyGUI_Prerequest.h"
27 #include "MyGUI_Widget.h"
28 #include "MyGUI_EventPair.h"
29 
30 namespace MyGUI
31 {
32 
34 
36  public Widget
37  {
39 
40  public:
41  VScroll();
42 
44  void setScrollRange(size_t _value);
46  size_t getScrollRange() { return mScrollRange; }
47 
49  void setScrollPosition(size_t _value);
51  size_t getScrollPosition() { return mScrollPosition; }
52 
56  void setScrollPage(size_t _value) { mScrollPage = _value; }
58  size_t getScrollPage() { return mScrollPage; }
59 
63  void setScrollViewPage(size_t _value) { mScrollViewPage = _value; }
65  size_t getScrollViewPage() { return mScrollViewPage; }
66 
68  virtual int getLineSize();
69 
73  virtual void setTrackSize(int _value);
75  virtual int getTrackSize();
76 
78  void setMinTrackSize(int _value) { mMinTrackSize = _value; }
80  int getMinTrackSize() { return mMinTrackSize; }
81 
86  void setMoveToClick(bool _value) { mMoveToClick = _value; }
88  bool getMoveToClick() { return mMoveToClick; }
89 
91  virtual void setPosition(const IntPoint& _value);
93  virtual void setSize(const IntSize& _value);
95  virtual void setCoord(const IntCoord& _value);
96 
98  void setPosition(int _left, int _top) { setPosition(IntPoint(_left, _top)); }
100  void setSize(int _width, int _height) { setSize(IntSize(_width, _height)); }
102  void setCoord(int _left, int _top, int _width, int _height) { setCoord(IntCoord(_left, _top, _width, _height)); }
103 
105  virtual void setProperty(const std::string& _key, const std::string& _value);
106 
107  /*event:*/
114 
115 
116  /*internal:*/
117  virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
118 
119  /*obsolete:*/
120 #ifndef MYGUI_DONT_USE_OBSOLETE
121 
122  MYGUI_OBSOLETE("use : void Widget::setCoord(const IntCoord& _coord)")
123  void setPosition(const IntCoord& _coord) { setCoord(_coord); }
124  MYGUI_OBSOLETE("use : void Widget::setCoord(int _left, int _top, int _width, int _height)")
125  void setPosition(int _left, int _top, int _width, int _height) { setCoord(_left, _top, _width, _height); }
126 
127 #endif // MYGUI_DONT_USE_OBSOLETE
128 
129  protected:
130  virtual ~VScroll();
131 
132  void baseChangeWidgetSkin(ResourceSkin* _info);
133 
134  virtual void updateTrack();
135  virtual void TrackMove(int _left, int _top);
136 
137  virtual void onMouseWheel(int _rel);
138 
139  void notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id);
140  void notifyMouseReleased(Widget* _sender, int _left, int _top, MouseButton _id);
141  void notifyMouseDrag(Widget* _sender, int _left, int _top);
142  void notifyMouseWheel(Widget* _sender, int _rel);
143 
144  private:
145  void initialiseWidgetSkin(ResourceSkin* _info);
146  void shutdownWidgetSkin();
147 
148  protected:
149  // наши кнопки
153  // куски между кнопками
156 
157  // смещение внутри окна
159 
160  // диапазон на который трек может двигаться
163 
164  size_t mScrollRange;
166  size_t mScrollPage; // на сколько перещелкивать, при щелчке на кнопке
167  size_t mScrollViewPage; // на сколько перещелкивать, при щелчке по полосе
168 
171 
172  };
173 
174 } // namespace MyGUI
175 
176 #endif // __MYGUI_VSCROLL_H__