Crazy Eddie's GUI System  0.8.7
widgets/ScrollablePane.h
1 /***********************************************************************
2  created: 1/3/2005
3  author: Paul D Turner
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2015 Paul D Turner & The CEGUI Development Team
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  ***************************************************************************/
27 #ifndef _CEGUIScrollablePane_h_
28 #define _CEGUIScrollablePane_h_
29 
30 #include "../Base.h"
31 #include "../Window.h"
32 
33 #if defined(_MSC_VER)
34 # pragma warning(push)
35 # pragma warning(disable : 4251)
36 #endif
37 
38 // Start of CEGUI namespace section
39 namespace CEGUI
40 {
42 class CEGUIEXPORT ScrollablePaneWindowRenderer : public WindowRenderer
43 {
44 public:
47 
56  virtual Rectf getViewableArea(void) const = 0;
57 };
58 
67 class CEGUIEXPORT ScrollablePane : public Window
68 {
69 public:
71  static const String WidgetTypeName;
73  static const String EventNamespace;
104  static const String VertScrollbarName;
106  static const String HorzScrollbarName;
109 
111  ScrollablePane(const String& type, const String& name);
112 
115 
116  virtual int writeChildWindowsXML(XMLSerializer& xml_stream) const;
117 
130  const ScrolledContainer* getContentPane(void) const;
131 
140  bool isVertScrollbarAlwaysShown(void) const;
141 
155  void setShowVertScrollbar(bool setting);
156 
165  bool isHorzScrollbarAlwaysShown(void) const;
166 
180  void setShowHorzScrollbar(bool setting);
181 
191  bool isContentPaneAutoSized(void) const;
192 
205  void setContentPaneAutoSized(bool setting);
206 
215  const Rectf& getContentPaneArea(void) const;
216 
232  void setContentPaneArea(const Rectf& area);
233 
243  float getHorizontalStepSize(void) const;
244 
257  void setHorizontalStepSize(float step);
258 
268  float getHorizontalOverlapSize(void) const;
269 
282  void setHorizontalOverlapSize(float overlap);
283 
292  float getHorizontalScrollPosition(void) const;
293 
305  void setHorizontalScrollPosition(float position);
306 
316  float getVerticalStepSize(void) const;
317 
330  void setVerticalStepSize(float step);
331 
341  float getVerticalOverlapSize(void) const;
342 
355  void setVerticalOverlapSize(float overlap);
356 
365  float getVerticalScrollPosition(void) const;
366 
378  void setVerticalScrollPosition(float position);
379 
388  Rectf getViewableArea(void) const;
389 
402 
415 
416  // Overridden from Window
418  void destroy(void);
419 
420 protected:
428 
437  bool isVertScrollbarNeeded(void) const;
438 
447  bool isHorzScrollbarNeeded(void) const;
448 
455 
468 
469  // validate window renderer
470  virtual bool validateWindowRenderer(const WindowRenderer* renderer) const;
471 
472  /*************************************************************************
473  Event triggers
474  *************************************************************************/
487 
500 
513 
526 
539 
540  /*************************************************************************
541  Event handler methods
542  *************************************************************************/
549 
556 
563 
564  // Overridden from Window
565  void addChild_impl(Element* element);
566  void removeChild_impl(Element* element);
567 
570 
572  NamedElement* getChildByNamePath_impl(const String& name_path) const;
573 
581  float d_vertStep;
585  float d_horzStep;
592 
593 private:
594  void addScrollablePaneProperties(void);
595 };
596 
597 } // End of CEGUI namespace section
598 
599 #if defined(_MSC_VER)
600 # pragma warning(pop)
601 #endif
602 
603 #endif // end of guard _CEGUIScrollablePane_h_
CEGUI::ScrollablePane::handleScrollChange
bool handleScrollChange(const EventArgs &e)
Handler method which gets subscribed to the scrollbar position change events.
CEGUI::ScrollablePane::EventContentPaneChanged
static const String EventContentPaneChanged
Definition: widgets/ScrollablePane.h:79
CEGUI::Scrollbar
Base scroll bar class.
Definition: widgets/Scrollbar.h:90
CEGUI::ScrollablePane::updateContainerPosition
void updateContainerPosition(void)
Update the content container position according to the current state of the widget (like scrollbar po...
CEGUI::ScrollablePane::isHorzScrollbarAlwaysShown
bool isHorzScrollbarAlwaysShown(void) const
Return whether the horizontal scroll bar is always shown.
CEGUI::ScrollablePane::handleAutoSizePaneChanged
bool handleAutoSizePaneChanged(const EventArgs &e)
Handler method which gets subscribed to the ScrolledContainer auto-size setting changes.
CEGUI::ScrollablePane
Base class for the ScrollablePane widget.
Definition: widgets/ScrollablePane.h:68
CEGUI::ScrollablePane::d_autoSizeChangedConn
Event::Connection d_autoSizeChangedConn
Event connection to content pane.
Definition: widgets/ScrollablePane.h:591
CEGUI::ScrollablePane::configureScrollbars
void configureScrollbars(void)
display required integrated scroll bars according to current size of the ScrollablePane view area and...
CEGUI::ScrollablePane::onContentPaneChanged
virtual void onContentPaneChanged(WindowEventArgs &e)
Event trigger method called when some pane content has changed size or location.
CEGUI::ScrollablePane::setVerticalScrollPosition
void setVerticalScrollPosition(float position)
Sets the vertical scroll position as a fraction of the complete scrollable height.
CEGUI::ScrollablePane::getVertScrollbar
Scrollbar * getVertScrollbar() const
Return a pointer to the vertical scrollbar component widget for this ScrollablePane.
CEGUI::ElementEventArgs
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: Element.h:211
CEGUI::ScrollablePane::validateWindowRenderer
virtual bool validateWindowRenderer(const WindowRenderer *renderer) const
Function used in checking if a WindowRenderer is valid for this window.
CEGUI::ScrollablePane::getVerticalStepSize
float getVerticalStepSize(void) const
Returns the vertical scrollbar step size as a fraction of one complete view page.
CEGUI::ScrollablePane::isVertScrollbarNeeded
bool isVertScrollbarNeeded(void) const
Return whether the vertical scrollbar is needed.
CEGUI::ScrollablePane::initialiseComponents
void initialiseComponents(void)
Initialises the Window based object ready for use.
CEGUI::ScrollablePane::setVerticalOverlapSize
void setVerticalOverlapSize(float overlap)
Sets the vertical scrollbar overlap size as a fraction of one complete view page.
CEGUI::ScrollablePane::d_horzOverlap
float d_horzOverlap
horizontal scroll overlap fraction.
Definition: widgets/ScrollablePane.h:587
CEGUI::XMLSerializer
Class used to create XML Document.
Definition: XMLSerializer.h:87
CEGUI::ScrollablePane::EventAutoSizeSettingChanged
static const String EventAutoSizeSettingChanged
Definition: widgets/ScrollablePane.h:97
CEGUI::ScrollablePane::getVerticalScrollPosition
float getVerticalScrollPosition(void) const
Returns the vertical scroll position as a fraction of the complete scrollable height.
CEGUI
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
CEGUI::MouseEventArgs
EventArgs based class that is used for objects passed to input event handlers concerning mouse input.
Definition: InputEvent.h:281
CEGUI::ScrollablePane::getViewableArea
Rectf getViewableArea(void) const
Return a Rect that described the pane's viewable area, relative to this Window, in pixels.
CEGUI::ScrollablePane::~ScrollablePane
~ScrollablePane(void)
Destructor for the ScrollablePane base class.
CEGUI::RefCounted< BoundSlot >
CEGUI::ScrollablePane::getChildByNamePath_impl
NamedElement * getChildByNamePath_impl(const String &name_path) const
Retrieves a child at name_path or 0 if none such exists.
CEGUI::ScrollablePane::setHorizontalStepSize
void setHorizontalStepSize(float step)
Sets the horizontal scrollbar step size as a fraction of one complete view page.
CEGUI::ScrollablePane::ScrollablePane
ScrollablePane(const String &type, const String &name)
Constructor for the ScrollablePane base class.
CEGUI::WindowEventArgs
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: InputEvent.h:252
CEGUI::ScrollablePane::d_vertStep
float d_vertStep
vertical scroll step fraction.
Definition: widgets/ScrollablePane.h:581
CEGUI::ScrollablePane::addChild_impl
void addChild_impl(Element *element)
Add given element to child list at an appropriate position.
CEGUI::ScrollablePane::d_vertOverlap
float d_vertOverlap
vertical scroll overlap fraction.
Definition: widgets/ScrollablePane.h:583
CEGUI::ScrollablePaneWindowRenderer::ScrollablePaneWindowRenderer
ScrollablePaneWindowRenderer(const String &name)
Constructor.
CEGUI::ScrollablePane::d_forceVertScroll
bool d_forceVertScroll
true if vertical scrollbar should always be displayed
Definition: widgets/ScrollablePane.h:575
CEGUI::ScrollablePane::d_horzStep
float d_horzStep
horizontal scroll step fraction.
Definition: widgets/ScrollablePane.h:585
CEGUI::ScrollablePaneWindowRenderer::getViewableArea
virtual Rectf getViewableArea(void) const =0
Return a Rect that described the pane's viewable area, relative to this Window, in pixels.
CEGUI::ScrollablePane::removeChild_impl
void removeChild_impl(Element *element)
Remove given element from child list.
CEGUI::ScrollablePane::getVerticalOverlapSize
float getVerticalOverlapSize(void) const
Returns the vertical scrollbar overlap size as a fraction of one complete view page.
CEGUI::ScrollablePane::onSized
void onSized(ElementEventArgs &e)
Handler called when the window's size changes.
CEGUI::ScrollablePane::ScrolledContainerName
static const String ScrolledContainerName
Widget name for the scrolled container component.
Definition: widgets/ScrollablePane.h:108
CEGUI::ScrollablePane::onAutoSizeSettingChanged
virtual void onAutoSizeSettingChanged(WindowEventArgs &e)
Notification method called whenever the setting that controls whether the content pane is automatical...
CEGUI::ScrollablePane::setShowVertScrollbar
void setShowVertScrollbar(bool setting)
Set whether the vertical scroll bar should always be shown.
CEGUI::ScrollablePaneWindowRenderer
Base class for ScrollablePane window renderer objects.
Definition: widgets/ScrollablePane.h:43
CEGUI::ScrollablePane::getHorizontalOverlapSize
float getHorizontalOverlapSize(void) const
Returns the horizontal scrollbar overlap size as a fraction of one complete view page.
CEGUI::ScrollablePane::setHorizontalOverlapSize
void setHorizontalOverlapSize(float overlap)
Sets the horizontal scrollbar overlap size as a fraction of one complete view page.
CEGUI::ScrollablePane::setContentPaneAutoSized
void setContentPaneAutoSized(bool setting)
Set whether the content pane should be auto-sized.
CEGUI::ScrollablePane::EventNamespace
static const String EventNamespace
Namespace for global events.
Definition: widgets/ScrollablePane.h:73
CEGUI::ScrollablePane::onMouseWheel
void onMouseWheel(MouseEventArgs &e)
Handler called when the mouse wheel (z-axis) position changes within this window's area.
CEGUI::ScrollablePane::onVertScrollbarModeChanged
virtual void onVertScrollbarModeChanged(WindowEventArgs &e)
Event trigger method called when the setting that controls whether the vertical scrollbar is always s...
CEGUI::ScrollablePane::handleContentAreaChange
bool handleContentAreaChange(const EventArgs &e)
Handler method which gets subscribed to the ScrolledContainer content change events.
CEGUI::ScrollablePane::d_forceHorzScroll
bool d_forceHorzScroll
true if horizontal scrollbar should always be displayed
Definition: widgets/ScrollablePane.h:577
CEGUI::ScrollablePane::WidgetTypeName
static const String WidgetTypeName
Window factory name.
Definition: widgets/ScrollablePane.h:71
CEGUI::ScrollablePane::EventHorzScrollbarModeChanged
static const String EventHorzScrollbarModeChanged
Definition: widgets/ScrollablePane.h:91
CEGUI::ScrollablePane::isHorzScrollbarNeeded
bool isHorzScrollbarNeeded(void) const
Return whether the horizontal scrollbar is needed.
CEGUI::ScrollablePane::isVertScrollbarAlwaysShown
bool isVertScrollbarAlwaysShown(void) const
Return whether the vertical scroll bar is always shown.
CEGUI::ScrollablePane::destroy
void destroy(void)
Internal destroy method which actually just adds the window and any parent destructed child windows t...
CEGUI::Window
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:151
CEGUI::ScrollablePane::getContentPane
const ScrolledContainer * getContentPane(void) const
Returns a pointer to the window holding the pane contents.
CEGUI::WindowRenderer
Base-class for the assignable WindowRenderer object.
Definition: WindowRenderer.h:52
CEGUI::ScrollablePane::getHorizontalStepSize
float getHorizontalStepSize(void) const
Returns the horizontal scrollbar step size as a fraction of one complete view page.
CEGUI::ScrollablePane::d_contentRect
Rectf d_contentRect
holds content area so we can track changes.
Definition: widgets/ScrollablePane.h:579
CEGUI::ScrollablePane::setContentPaneArea
void setContentPaneArea(const Rectf &area)
Set the current content pane area for the ScrollablePane.
CEGUI::ScrollablePane::EventVertScrollbarModeChanged
static const String EventVertScrollbarModeChanged
Definition: widgets/ScrollablePane.h:85
CEGUI::ScrollablePane::setHorizontalScrollPosition
void setHorizontalScrollPosition(float position)
Sets the horizontal scroll position as a fraction of the complete scrollable width.
CEGUI::ScrollablePane::isContentPaneAutoSized
bool isContentPaneAutoSized(void) const
Return whether the content pane is auto sized.
CEGUI::ScrollablePane::getScrolledContainer
ScrolledContainer * getScrolledContainer() const
Return a pointer to the ScrolledContainer component widget for this ScrollablePane.
CEGUI::String
String class used within the GUI system.
Definition: String.h:64
CEGUI::ScrollablePane::getHorizontalScrollPosition
float getHorizontalScrollPosition(void) const
Returns the horizontal scroll position as a fraction of the complete scrollable width.
CEGUI::ScrollablePane::onContentPaneScrolled
virtual void onContentPaneScrolled(WindowEventArgs &e)
Notification method called whenever the content pane is scrolled via changes in the scrollbar positio...
CEGUI::ScrollablePane::HorzScrollbarName
static const String HorzScrollbarName
Widget name for the horizontal scrollbar component.
Definition: widgets/ScrollablePane.h:106
CEGUI::ScrollablePane::d_contentChangedConn
Event::Connection d_contentChangedConn
Event connection to content pane.
Definition: widgets/ScrollablePane.h:589
CEGUI::ScrolledContainer
Helper container window class which is used in the implementation of the ScrollablePane widget class.
Definition: ScrolledContainer.h:48
CEGUI::Rect< float >
CEGUI::ScrollablePane::setVerticalStepSize
void setVerticalStepSize(float step)
Sets the vertical scrollbar step size as a fraction of one complete view page.
CEGUI::ScrollablePane::getContentPaneArea
const Rectf & getContentPaneArea(void) const
Return the current content pane area for the ScrollablePane.
CEGUI::ScrollablePane::getHorzScrollbar
Scrollbar * getHorzScrollbar() const
Return a pointer to the horizontal scrollbar component widget for this ScrollablePane.
CEGUI::ScrollablePane::setShowHorzScrollbar
void setShowHorzScrollbar(bool setting)
Set whether the horizontal scroll bar should always be shown.
CEGUI::ScrollablePane::onHorzScrollbarModeChanged
virtual void onHorzScrollbarModeChanged(WindowEventArgs &e)
Event trigger method called when the setting that controls whether the horizontal scrollbar is always...
CEGUI::ScrollablePane::VertScrollbarName
static const String VertScrollbarName
Widget name for the vertical scrollbar component.
Definition: widgets/ScrollablePane.h:104
CEGUI::EventArgs
Base class used as the argument to all subscribers Event object.
Definition: EventArgs.h:51
CEGUI::NamedElement
Adds name to the Element class, including name path traversal.
Definition: NamedElement.h:76
CEGUI::Element
A positioned and sized rectangular node in a tree graph.
Definition: Element.h:246
CEGUI::ScrollablePane::EventContentPaneScrolled
static const String EventContentPaneScrolled
Definition: widgets/ScrollablePane.h:102