MyGUI
3.0.1
|
00001 00007 /* 00008 This file is part of MyGUI. 00009 00010 MyGUI is free software: you can redistribute it and/or modify 00011 it under the terms of the GNU Lesser General Public License as published by 00012 the Free Software Foundation, either version 3 of the License, or 00013 (at your option) any later version. 00014 00015 MyGUI is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU Lesser General Public License for more details. 00019 00020 You should have received a copy of the GNU Lesser General Public License 00021 along with MyGUI. If not, see <http://www.gnu.org/licenses/>. 00022 */ 00023 #ifndef __MYGUI_SCROLL_VIEW_BASE_H__ 00024 #define __MYGUI_SCROLL_VIEW_BASE_H__ 00025 00026 #include "MyGUI_Prerequest.h" 00027 #include "MyGUI_Types.h" 00028 00029 namespace MyGUI 00030 { 00031 00032 class ScrollViewBase 00033 { 00034 00035 protected: 00036 ScrollViewBase(); 00037 virtual ~ScrollViewBase() { } 00038 00039 void updateScrollSize(); 00040 void updateScrollPosition(); 00041 00042 // размер данных 00043 virtual IntSize getContentSize() { return IntSize(); } 00044 // смещение данных 00045 virtual IntPoint getContentPosition() { return IntPoint(); } 00046 virtual void setContentPosition(const IntPoint& _value) { } 00047 // размер окна, через которые видно данные 00048 virtual IntSize getViewSize() const { return IntSize(); } 00049 // размер на который прокручиваются данные при щелчке по скролу 00050 virtual size_t getHScrollPage() { return 1; } 00051 virtual size_t getVScrollPage() { return 1; } 00052 00053 virtual Align getContentAlign() { return Align::Center; } 00054 00055 virtual void eraseContent() { } 00056 00057 protected: 00058 VScroll* mVScroll; 00059 HScroll* mHScroll; 00060 Widget* mClient; 00061 00062 bool mVisibleHScroll; 00063 bool mVisibleVScroll; 00064 00065 size_t mVRange; 00066 size_t mHRange; 00067 00068 // изменяется ли содержимое при ресайзе 00069 bool mChangeContentByResize; 00070 00071 }; 00072 00073 } // namespace MyGUI 00074 00075 #endif // __MYGUI_SCROLL_VIEW_BASE_H__