MyGUI  3.2.1
MyGUI_ScrollView.h
Go to the documentation of this file.
00001 /*
00002  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
00003  * Distributed under the MIT License
00004  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
00005  */
00006 
00007 #ifndef __MYGUI_SCROLL_VIEW_H__
00008 #define __MYGUI_SCROLL_VIEW_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include "MyGUI_Widget.h"
00012 #include "MyGUI_ScrollViewBase.h"
00013 
00014 namespace MyGUI
00015 {
00016 
00020     class MYGUI_EXPORT ScrollView :
00021         public Widget,
00022         protected ScrollViewBase,
00023         public MemberObsolete<ScrollView>
00024     {
00025         MYGUI_RTTI_DERIVED( ScrollView )
00026 
00027     public:
00028         ScrollView();
00029 
00031         virtual void setPosition(const IntPoint& _value);
00033         virtual void setSize(const IntSize& _value);
00035         virtual void setCoord(const IntCoord& _value);
00036 
00038         void setPosition(int _left, int _top);
00040         void setSize(int _width, int _height);
00042         void setCoord(int _left, int _top, int _width, int _height);
00043 
00045         void setVisibleVScroll(bool _value);
00047         bool isVisibleVScroll() const;
00048 
00050         void setVisibleHScroll(bool _value);
00052         bool isVisibleHScroll() const;
00053 
00055         void setCanvasAlign(Align _value);
00057         Align getCanvasAlign() const;
00058 
00060         void setCanvasSize(const IntSize& _value);
00062         void setCanvasSize(int _width, int _height);
00064         IntSize getCanvasSize();
00065 
00067         IntCoord getViewCoord() const;
00068 
00070         void setViewOffset(const IntPoint& _value);
00072         IntPoint getViewOffset() const;
00073 
00074     protected:
00075         virtual void initialiseOverride();
00076         virtual void shutdownOverride();
00077 
00078         void notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id);
00079         void notifyMouseReleased(Widget* _sender, int _left, int _top, MouseButton _id);
00080 
00081         void notifyScrollChangePosition(ScrollBar* _sender, size_t _position);
00082         void notifyMouseWheel(Widget* _sender, int _rel);
00083 
00084         void updateView();
00085 
00086         virtual void setPropertyOverride(const std::string& _key, const std::string& _value);
00087 
00088         ScrollBar* getVScroll();
00089 
00090     private:
00091         // размер данных
00092         virtual IntSize getContentSize();
00093         // смещение данных
00094         virtual IntPoint getContentPosition();
00095         // размер окна, через которые видно данные
00096         virtual IntSize getViewSize();
00097         virtual void setContentPosition(const IntPoint& _point);
00098         // размер на который прокручиваются данные при щелчке по скролу
00099         virtual size_t getVScrollPage();
00100         virtual size_t getHScrollPage();
00101 
00102         virtual Align getContentAlign();
00103 
00104     protected:
00105         Align mContentAlign;
00106         Widget* mRealClient;
00107     };
00108 
00109 } // namespace MyGUI
00110 
00111 #endif // __MYGUI_SCROLL_VIEW_H__