MyGUI
3.2.0
|
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_SCROLL_VIEW_H__ 00023 #define __MYGUI_SCROLL_VIEW_H__ 00024 00025 #include "MyGUI_Prerequest.h" 00026 #include "MyGUI_Widget.h" 00027 #include "MyGUI_ScrollViewBase.h" 00028 00029 namespace MyGUI 00030 { 00031 00032 class MYGUI_EXPORT ScrollView : 00033 public Widget, 00034 protected ScrollViewBase, 00035 public MemberObsolete<ScrollView> 00036 { 00037 MYGUI_RTTI_DERIVED( ScrollView ) 00038 00039 public: 00040 ScrollView(); 00041 00043 virtual void setPosition(const IntPoint& _value); 00045 virtual void setSize(const IntSize& _value); 00047 virtual void setCoord(const IntCoord& _value); 00048 00050 void setPosition(int _left, int _top); 00052 void setSize(int _width, int _height); 00054 void setCoord(int _left, int _top, int _width, int _height); 00055 00057 void setVisibleVScroll(bool _value); 00059 bool isVisibleVScroll() const; 00060 00062 void setVisibleHScroll(bool _value); 00064 bool isVisibleHScroll() const; 00065 00067 void setCanvasAlign(Align _value); 00069 Align getCanvasAlign() const; 00070 00072 void setCanvasSize(const IntSize& _value); 00074 void setCanvasSize(int _width, int _height); 00076 IntSize getCanvasSize(); 00077 00079 IntCoord getViewCoord() const; 00080 00082 void setViewOffset(const IntPoint& _value); 00084 IntPoint getViewOffset() const; 00085 00086 protected: 00087 virtual void initialiseOverride(); 00088 virtual void shutdownOverride(); 00089 00090 void notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id); 00091 void notifyMouseReleased(Widget* _sender, int _left, int _top, MouseButton _id); 00092 00093 void notifyScrollChangePosition(ScrollBar* _sender, size_t _position); 00094 void notifyMouseWheel(Widget* _sender, int _rel); 00095 00096 void updateView(); 00097 00098 virtual void setPropertyOverride(const std::string& _key, const std::string& _value); 00099 00100 ScrollBar* getVScroll(); 00101 00102 private: 00103 // размер данных 00104 virtual IntSize getContentSize(); 00105 // смещение данных 00106 virtual IntPoint getContentPosition(); 00107 // размер окна, через которые видно данные 00108 virtual IntSize getViewSize(); 00109 virtual void setContentPosition(const IntPoint& _point); 00110 // размер на который прокручиваются данные при щелчке по скролу 00111 virtual size_t getVScrollPage(); 00112 virtual size_t getHScrollPage(); 00113 00114 virtual Align getContentAlign(); 00115 00116 protected: 00117 Align mContentAlign; 00118 Widget* mRealClient; 00119 }; 00120 00121 } // namespace MyGUI 00122 00123 #endif // __MYGUI_SCROLL_VIEW_H__