00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _CEGUIScrolledContainer_h_
00025 #define _CEGUIScrolledContainer_h_
00026
00027 #include "CEGUIWindow.h"
00028 #include "CEGUIWindowFactory.h"
00029 #include "elements/CEGUIScrolledContainerProperties.h"
00030 #include <map>
00031
00032 #if defined(_MSC_VER)
00033 # pragma warning(push)
00034 # pragma warning(disable : 4251)
00035 #endif
00036
00037
00038 namespace CEGUI
00039 {
00045 class CEGUIEXPORT ScrolledContainer : public Window
00046 {
00047 public:
00048
00049
00050
00051 static const String WidgetTypeName;
00052 static const String EventNamespace;
00053 static const String EventContentChanged;
00054 static const String EventAutoSizeSettingChanged;
00055
00056
00057
00058
00063 ScrolledContainer(const String& type, const String& name);
00064
00069 ~ScrolledContainer(void);
00070
00071
00072
00073
00082 bool isContentPaneAutoSized(void) const;
00083
00095 void setContentPaneAutoSized(bool setting);
00096
00105 const Rect& getContentArea(void) const;
00106
00122 void setContentArea(const Rect& area);
00123
00133 Rect getChildExtentsArea(void) const;
00134
00135 protected:
00136
00137
00138
00143 void addScrolledContainerEvents(void);
00144
00145
00156 virtual bool testClassName_impl(const String& class_name) const
00157 {
00158 if (class_name==(const utf8*)"ScrolledContainer") return true;
00159 return Window::testClassName_impl(class_name);
00160 }
00161
00162
00163
00164
00165 void drawSelf(float z) {};
00166
00167
00168
00169
00180 virtual void onContentChanged(WindowEventArgs& e);
00181
00193 virtual void onAutoSizeSettingChanged(WindowEventArgs& e);
00194
00195
00196
00197
00202 bool handleChildSized(const EventArgs& e);
00203
00208 bool handleChildMoved(const EventArgs& e);
00209
00210
00211
00212
00213 Rect getUnclippedInnerRect(void) const;
00214 void onChildAdded(WindowEventArgs& e);
00215 void onChildRemoved(WindowEventArgs& e);
00216 void onParentSized(WindowEventArgs& e);
00217
00218
00219
00220
00221 typedef std::multimap<Window*, Event::Connection> ConnectionTracker;
00222 ConnectionTracker d_eventConnections;
00223 Rect d_contentArea;
00224 bool d_autosizePane;
00225
00226 private:
00227
00228
00229
00230 static ScrolledContainerProperties::ContentPaneAutoSized d_autoSizedProperty;
00231 static ScrolledContainerProperties::ContentArea d_contentAreaProperty;
00232 static ScrolledContainerProperties::ChildExtentsArea d_childExtentsAreaProperty;
00233
00234
00235
00236
00237 void addScrolledContainerProperties(void);
00238 };
00239
00244 class ScrolledContainerFactory : public WindowFactory
00245 {
00246 public:
00247 ScrolledContainerFactory(void) : WindowFactory(ScrolledContainer::WidgetTypeName) { }
00248 ~ScrolledContainerFactory(void){}
00249
00250 Window* createWindow(const String& name)
00251 {
00252 ScrolledContainer* wnd = new ScrolledContainer(d_type, name);
00253 return wnd;
00254 }
00255
00256 void destroyWindow(Window* window)
00257 {
00258 if (window->getType() == d_type)
00259 delete window;
00260 }
00261
00262 };
00263
00264 }
00265
00266
00267 #if defined(_MSC_VER)
00268 # pragma warning(pop)
00269 #endif
00270
00271 #endif // end of guard _CEGUIScrolledContainer_h_