MyGUI  3.2.0
MyGUI_ProgressBar.h
Go to the documentation of this file.
00001 
00006 /*
00007     This file is part of MyGUI.
00008 
00009     MyGUI is free software: you can redistribute it and/or modify
00010     it under the terms of the GNU Lesser General Public License as published by
00011     the Free Software Foundation, either version 3 of the License, or
00012     (at your option) any later version.
00013 
00014     MyGUI is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU Lesser General Public License for more details.
00018 
00019     You should have received a copy of the GNU Lesser General Public License
00020     along with MyGUI.  If not, see <http://www.gnu.org/licenses/>.
00021 */
00022 #ifndef __MYGUI_PROGRESS_BAR_H__
00023 #define __MYGUI_PROGRESS_BAR_H__
00024 
00025 #include "MyGUI_Prerequest.h"
00026 #include "MyGUI_Align.h"
00027 #include "MyGUI_FlowDirection.h"
00028 #include "MyGUI_Widget.h"
00029 
00030 namespace MyGUI
00031 {
00032 
00033     class MYGUI_EXPORT ProgressBar :
00034         public Widget,
00035         public MemberObsolete<ProgressBar>
00036     {
00037         MYGUI_RTTI_DERIVED( ProgressBar )
00038 
00039     public:
00040         ProgressBar();
00041 
00043         void setProgressRange(size_t _value);
00045         size_t getProgressRange() const;
00046 
00048         void setProgressPosition(size_t _value);
00050         size_t getProgressPosition() const;
00051 
00053         void setProgressAutoTrack(bool _value);
00055         bool getProgressAutoTrack() const;
00056 
00057         void setFlowDirection(FlowDirection _value);
00058         FlowDirection getFlowDirection() const;
00059 
00061         virtual void setPosition(const IntPoint& _value);
00063         virtual void setSize(const IntSize& _value);
00065         virtual void setCoord(const IntCoord& _value);
00066 
00068         void setPosition(int _left, int _top);
00070         void setSize(int _width, int _height);
00072         void setCoord(int _left, int _top, int _width, int _height);
00073 
00074     protected:
00075         virtual void initialiseOverride();
00076         virtual void shutdownOverride();
00077 
00078         virtual void setPropertyOverride(const std::string& _key, const std::string& _value);
00079 
00080     private:
00081         void frameEntered(float _time);
00082         void updateTrack();
00083 
00084         int getClientWidth();
00085         int getClientHeight();
00086 
00087         void setTrackPosition(Widget* _widget, int _left, int _top, int _width, int _height);
00088 
00089     private:
00090         std::string mTrackSkin;
00091         int mTrackWidth;
00092         int mTrackStep;
00093         int mTrackMin;
00094 
00095         VectorWidgetPtr mVectorTrack;
00096         size_t mRange;
00097         size_t mStartPosition, mEndPosition;
00098         float mAutoPosition;
00099         bool mAutoTrack;
00100         bool mFillTrack;
00101 
00102         FlowDirection mFlowDirection;
00103 
00104         Widget* mClient;
00105     };
00106 
00107 } // namespace MyGUI
00108 
00109 #endif // __MYGUI_PROGRESS_BAR_H__