MyGUI  3.2.1
MyGUI_ProgressBar.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_PROGRESS_BAR_H__
8 #define __MYGUI_PROGRESS_BAR_H__
9 
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_Align.h"
12 #include "MyGUI_FlowDirection.h"
13 #include "MyGUI_Widget.h"
14 
15 namespace MyGUI
16 {
17 
22  public Widget,
23  public MemberObsolete<ProgressBar>
24  {
26 
27  public:
28  ProgressBar();
29 
31  void setProgressRange(size_t _value);
33  size_t getProgressRange() const;
34 
36  void setProgressPosition(size_t _value);
38  size_t getProgressPosition() const;
39 
41  void setProgressAutoTrack(bool _value);
43  bool getProgressAutoTrack() const;
44 
45  void setFlowDirection(FlowDirection _value);
46  FlowDirection getFlowDirection() const;
47 
49  virtual void setPosition(const IntPoint& _value);
51  virtual void setSize(const IntSize& _value);
53  virtual void setCoord(const IntCoord& _value);
54 
56  void setPosition(int _left, int _top);
58  void setSize(int _width, int _height);
60  void setCoord(int _left, int _top, int _width, int _height);
61 
62  protected:
63  virtual void initialiseOverride();
64  virtual void shutdownOverride();
65 
66  virtual void setPropertyOverride(const std::string& _key, const std::string& _value);
67 
68  private:
69  void frameEntered(float _time);
70  void updateTrack();
71 
72  int getClientWidth();
73  int getClientHeight();
74 
75  void setTrackPosition(Widget* _widget, int _left, int _top, int _width, int _height);
76 
77  private:
78  std::string mTrackSkin;
79  int mTrackWidth;
80  int mTrackStep;
81  int mTrackMin;
82 
83  VectorWidgetPtr mVectorTrack;
84  size_t mRange;
85  size_t mStartPosition, mEndPosition;
86  float mAutoPosition;
87  bool mAutoTrack;
88  bool mFillTrack;
89 
90  FlowDirection mFlowDirection;
91 
92  Widget* mClient;
93  };
94 
95 } // namespace MyGUI
96 
97 #endif // __MYGUI_PROGRESS_BAR_H__