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 _CEGUIScrollablePane_h_
00025 #define _CEGUIScrollablePane_h_
00026
00027 #include "CEGUIBase.h"
00028 #include "CEGUIWindow.h"
00029 #include "elements/CEGUIScrollablePaneProperties.h"
00030
00031 #if defined(_MSC_VER)
00032 # pragma warning(push)
00033 # pragma warning(disable : 4251)
00034 #endif
00035
00036
00037 namespace CEGUI
00038 {
00047 class CEGUIEXPORT ScrollablePane : public Window
00048 {
00049 public:
00050
00051
00052
00053 static const String EventNamespace;
00054 static const String EventContentPaneChanged;
00055 static const String EventVertScrollbarModeChanged;
00056 static const String EventHorzScrollbarModeChanged;
00057 static const String EventAutoSizeSettingChanged;
00058 static const String EventContentPaneScrolled;
00059
00060
00061
00062
00067 ScrollablePane(const String& type, const String& name);
00068
00073 ~ScrollablePane(void);
00074
00075
00076
00077
00090 const ScrolledContainer* getContentPane(void) const;
00091
00100 bool isVertScrollbarAlwaysShown(void) const;
00112 void setShowVertScrollbar(bool setting);
00113
00122 bool isHorzScrollbarAlwaysShown(void) const;
00123
00135 void setShowHorzScrollbar(bool setting);
00136
00145 bool isContentPaneAutoSized(void) const;
00146
00158 void setContentPaneAutoSized(bool setting);
00159
00168 const Rect& getContentPaneArea(void) const;
00169
00185 void setContentPaneArea(const Rect& area);
00186
00196 float getHorizontalStepSize(void) const;
00197
00210 void setHorizontalStepSize(float step);
00211
00221 float getHorizontalOverlapSize(void) const;
00222
00235 void setHorizontalOverlapSize(float overlap);
00236
00245 float getHorizontalScrollPosition(void) const;
00246
00258 void setHorizontalScrollPosition(float position);
00259
00269 float getVerticalStepSize(void) const;
00270
00283 void setVerticalStepSize(float step);
00284
00294 float getVerticalOverlapSize(void) const;
00295
00308 void setVerticalOverlapSize(float overlap);
00309
00318 float getVerticalScrollPosition(void) const;
00319
00331 void setVerticalScrollPosition(float position);
00332
00333
00334
00335
00336 void initialise(void);
00337
00338 protected:
00339
00340
00341
00352 virtual Scrollbar* createHorizontalScrollbar(const String& name) const = 0;
00353
00364 virtual Scrollbar* createVerticalScrollbar(const String& name) const = 0;
00365
00374 virtual Rect getViewableArea(void) const = 0;
00375
00376
00377
00378
00383 void addScrollablePaneEvents(void);
00384
00390 void configureScrollbars(void);
00391
00400 bool isVertScrollbarNeeded(void) const;
00401
00410 bool isHorzScrollbarNeeded(void) const;
00411
00417 void updateContainerPosition(void);
00418
00419
00430 virtual bool testClassName_impl(const String& class_name) const
00431 {
00432 if (class_name==(const utf8*)"ScrollablePane") return true;
00433 return Window::testClassName_impl(class_name);
00434 }
00435
00436
00437
00438
00439
00451 virtual void onContentPaneChanged(WindowEventArgs& e);
00452
00464 virtual void onVertScrollbarModeChanged(WindowEventArgs& e);
00465
00477 virtual void onHorzScrollbarModeChanged(WindowEventArgs& e);
00478
00490 virtual void onAutoSizeSettingChanged(WindowEventArgs& e);
00491
00503 virtual void onContentPaneScrolled(WindowEventArgs& e);
00504
00505
00506
00507
00513 bool handleScrollChange(const EventArgs& e);
00514
00520 bool handleContentAreaChange(const EventArgs& e);
00521
00527 bool handleAutoSizePaneChanged(const EventArgs& e);
00528
00529
00530
00531
00532 void addChild_impl(Window* wnd);
00533 void removeChild_impl(Window* wnd);
00534 void onSized(WindowEventArgs& e);
00535 void onMouseWheel(MouseEventArgs& e);
00536
00537
00538
00539
00540 bool d_forceVertScroll;
00541 bool d_forceHorzScroll;
00542 Rect d_contentRect;
00543 float d_vertStep;
00544 float d_vertOverlap;
00545 float d_horzStep;
00546 float d_horzOverlap;
00547
00548
00549 Scrollbar* d_vertScrollbar;
00550 Scrollbar* d_horzScrollbar;
00551 ScrolledContainer* d_container;
00552
00553 private:
00554
00555
00556
00557 static ScrollablePaneProperties::ForceHorzScrollbar d_horzScrollbarProperty;
00558 static ScrollablePaneProperties::ForceVertScrollbar d_vertScrollbarProperty;
00559 static ScrollablePaneProperties::ContentPaneAutoSized d_autoSizedProperty;
00560 static ScrollablePaneProperties::ContentArea d_contentAreaProperty;
00561 static ScrollablePaneProperties::HorzStepSize d_horzStepProperty;
00562 static ScrollablePaneProperties::HorzOverlapSize d_horzOverlapProperty;
00563 static ScrollablePaneProperties::HorzScrollPosition d_horzScrollPositionProperty;
00564 static ScrollablePaneProperties::VertStepSize d_vertStepProperty;
00565 static ScrollablePaneProperties::VertOverlapSize d_vertOverlapProperty;
00566 static ScrollablePaneProperties::VertScrollPosition d_vertScrollPositionProperty;
00567
00568
00569
00570
00571 void addScrollablePaneProperties(void);
00572 };
00573
00574 }
00575
00576
00577 #if defined(_MSC_VER)
00578 # pragma warning(pop)
00579 #endif
00580
00581 #endif // end of guard _CEGUIScrollablePane_h_