Public Member Functions | |
ScrollablePane (const String &type, const String &name) | |
Constructor for the ScrollablePane base class. | |
~ScrollablePane (void) | |
Destructor for the ScrollablePane base class. | |
const ScrolledContainer * | getContentPane (void) const |
Returns a pointer to the window holding the pane contents. | |
bool | isVertScrollbarAlwaysShown (void) const |
Return whether the vertical scroll bar is always shown. | |
void | setShowVertScrollbar (bool setting) |
Set whether the vertical scroll bar should always be shown. | |
bool | isHorzScrollbarAlwaysShown (void) const |
Return whether the horizontal scroll bar is always shown. | |
void | setShowHorzScrollbar (bool setting) |
Set whether the horizontal scroll bar should always be shown. | |
bool | isContentPaneAutoSized (void) const |
Return whether the content pane is auto sized. | |
void | setContentPaneAutoSized (bool setting) |
Set whether the content pane should be auto-sized. | |
const Rect & | getContentPaneArea (void) const |
Return the current content pane area for the ScrollablePane. | |
void | setContentPaneArea (const Rect &area) |
Set the current content pane area for the ScrollablePane. | |
float | getHorizontalStepSize (void) const |
Returns the horizontal scrollbar step size as a fraction of one complete view page. | |
void | setHorizontalStepSize (float step) |
Sets the horizontal scrollbar step size as a fraction of one complete view page. | |
float | getHorizontalOverlapSize (void) const |
Returns the horizontal scrollbar overlap size as a fraction of one complete view page. | |
void | setHorizontalOverlapSize (float overlap) |
Sets the horizontal scrollbar overlap size as a fraction of one complete view page. | |
float | getHorizontalScrollPosition (void) const |
Returns the horizontal scroll position as a fraction of the complete scrollable width. | |
void | setHorizontalScrollPosition (float position) |
Sets the horizontal scroll position as a fraction of the complete scrollable width. | |
float | getVerticalStepSize (void) const |
Returns the vertical scrollbar step size as a fraction of one complete view page. | |
void | setVerticalStepSize (float step) |
Sets the vertical scrollbar step size as a fraction of one complete view page. | |
float | getVerticalOverlapSize (void) const |
Returns the vertical scrollbar overlap size as a fraction of one complete view page. | |
void | setVerticalOverlapSize (float overlap) |
Sets the vertical scrollbar overlap size as a fraction of one complete view page. | |
float | getVerticalScrollPosition (void) const |
Returns the vertical scroll position as a fraction of the complete scrollable height. | |
void | setVerticalScrollPosition (float position) |
Sets the vertical scroll position as a fraction of the complete scrollable height. | |
Rect | getViewableArea (void) const |
Return a Rect that described the pane's viewable area, relative to this Window, in pixels. | |
Scrollbar * | getVertScrollbar () const |
Return a pointer to the vertical scrollbar component widget for this ScrollablePane. | |
Scrollbar * | getHorzScrollbar () const |
Return a pointer to the horizontal scrollbar component widget for this ScrollablePane. | |
void | initialiseComponents (void) |
Initialises the Window based object ready for use. | |
void | destroy (void) |
Internal destroy method which actually just adds the window and any parent destructed child windows to the dead pool. | |
Static Public Attributes | |
static const String | WidgetTypeName |
Window factory name. | |
static const String | EventNamespace |
Namespace for global events. | |
static const String | EventContentPaneChanged |
Event fired when an area on the content pane has been updated. | |
static const String | EventVertScrollbarModeChanged |
Event triggered when the vertical scroll bar 'force' setting changes. | |
static const String | EventHorzScrollbarModeChanged |
Event triggered when the horizontal scroll bar 'force' setting changes. | |
static const String | EventAutoSizeSettingChanged |
Event fired when the auto size setting changes. | |
static const String | EventContentPaneScrolled |
Event fired when the pane gets scrolled. | |
static const String | VertScrollbarNameSuffix |
Widget name suffix for the vertical scrollbar component. | |
static const String | HorzScrollbarNameSuffix |
Widget name suffix for the horizontal scrollbar component. | |
static const String | ScrolledContainerNameSuffix |
Widget name suffix for the scrolled container component. | |
Protected Member Functions | |
void | configureScrollbars (void) |
Return a Rect that described the pane's viewable area, relative to this Window, in pixels. | |
bool | isVertScrollbarNeeded (void) const |
Return whether the vertical scrollbar is needed. | |
bool | isHorzScrollbarNeeded (void) const |
Return whether the horizontal scrollbar is needed. | |
void | updateContainerPosition (void) |
Update the content container position according to the current state of the widget (like scrollbar positions, etc). | |
virtual bool | testClassName_impl (const String &class_name) const |
Return whether this window was inherited from the given class name at some point in the inheritance hierarchy. | |
ScrolledContainer * | getScrolledContainer () const |
Return a pointer to the ScrolledContainer component widget for this ScrollablePane. | |
virtual bool | validateWindowRenderer (const String &name) const |
Function used in checking if a WindowRenderer is valid for this window. | |
virtual void | onContentPaneChanged (WindowEventArgs &e) |
Event trigger method called when some pane content has changed size or location. | |
virtual void | onVertScrollbarModeChanged (WindowEventArgs &e) |
Event trigger method called when the setting that controls whether the vertical scrollbar is always shown or not, is changed. | |
virtual void | onHorzScrollbarModeChanged (WindowEventArgs &e) |
Event trigger method called when the setting that controls whether the horizontal scrollbar is always shown or not, is changed. | |
virtual void | onAutoSizeSettingChanged (WindowEventArgs &e) |
Notification method called whenever the setting that controls whether the content pane is automatically sized is changed. | |
virtual void | onContentPaneScrolled (WindowEventArgs &e) |
Notification method called whenever the content pane is scrolled via changes in the scrollbar positions. | |
bool | handleScrollChange (const EventArgs &e) |
Handler method which gets subscribed to the scrollbar position change events. | |
bool | handleContentAreaChange (const EventArgs &e) |
Handler method which gets subscribed to the ScrolledContainer content change events. | |
bool | handleAutoSizePaneChanged (const EventArgs &e) |
Handler method which gets subscribed to the ScrolledContainer auto-size setting changes. | |
void | addChild_impl (Window *wnd) |
Add given window to child list at an appropriate position. | |
void | removeChild_impl (Window *wnd) |
Remove given window from child list. | |
void | onSized (WindowEventArgs &e) |
Handler called when the window's size changes. | |
void | onMouseWheel (MouseEventArgs &e) |
Handler called when the mouse wheel (z-axis) position changes within this window's area. | |
Protected Attributes | |
bool | d_forceVertScroll |
true if vertical scrollbar should always be displayed | |
bool | d_forceHorzScroll |
true if horizontal scrollbar should always be displayed | |
Rect | d_contentRect |
holds content area so we can track changes. | |
float | d_vertStep |
vertical scroll step fraction. | |
float | d_vertOverlap |
vertical scroll overlap fraction. | |
float | d_horzStep |
horizontal scroll step fraction. | |
float | d_horzOverlap |
horizontal scroll overlap fraction. | |
Event::Connection | d_contentChangedConn |
Event connection to content pane. | |
Event::Connection | d_autoSizeChangedConn |
Event connection to content pane. |
The ScrollablePane widget allows child windows to be attached which cover an area larger than the ScrollablePane itself and these child windows can be scrolled into view using the scrollbars of the scrollable pane.
void CEGUI::ScrollablePane::configureScrollbars | ( | void | ) | [protected] |
Return a Rect that described the pane's viewable area, relative to this Window, in pixels.
References d_contentRect, d_horzOverlap, d_horzStep, d_vertOverlap, d_vertStep, CEGUI::Rect::getHeight(), getHorzScrollbar(), CEGUI::Scrollbar::getScrollPosition(), getVertScrollbar(), getViewableArea(), CEGUI::Rect::getWidth(), isHorzScrollbarNeeded(), isVertScrollbarNeeded(), CEGUI::Window::isVisible(), CEGUI::Window::performChildWindowLayout(), CEGUI::Scrollbar::setDocumentSize(), CEGUI::Scrollbar::setOverlapSize(), CEGUI::Scrollbar::setPageSize(), CEGUI::Scrollbar::setScrollPosition(), CEGUI::Scrollbar::setStepSize(), and CEGUI::Window::setVisible().
Referenced by handleContentAreaChange(), initialiseComponents(), onSized(), setHorizontalOverlapSize(), setHorizontalStepSize(), setShowHorzScrollbar(), setShowVertScrollbar(), setVerticalOverlapSize(), and setVerticalStepSize().
void CEGUI::ScrollablePane::destroy | ( | void | ) | [virtual] |
Internal destroy method which actually just adds the window and any parent destructed child windows to the dead pool.
This is virtual to allow for specialised cleanup which may be required in some advanced cases. If you override this for the above reason, you MUST call this base class version.
Reimplemented from CEGUI::Window.
References d_autoSizeChangedConn, and d_contentChangedConn.
const ScrolledContainer * CEGUI::ScrollablePane::getContentPane | ( | void | ) | const |
Returns a pointer to the window holding the pane contents.
The purpose of this is so that attached windows may be inspected, client code may not modify the returned window in any way.
References getScrolledContainer().
const Rect & CEGUI::ScrollablePane::getContentPaneArea | ( | void | ) | const |
Return the current content pane area for the ScrollablePane.
References CEGUI::ScrolledContainer::getContentArea(), and getScrolledContainer().
float CEGUI::ScrollablePane::getHorizontalOverlapSize | ( | void | ) | const |
Returns the horizontal scrollbar overlap size as a fraction of one complete view page.
References d_horzOverlap.
float CEGUI::ScrollablePane::getHorizontalScrollPosition | ( | void | ) | const |
Returns the horizontal scroll position as a fraction of the complete scrollable width.
References CEGUI::Scrollbar::getDocumentSize(), getHorzScrollbar(), and CEGUI::Scrollbar::getScrollPosition().
float CEGUI::ScrollablePane::getHorizontalStepSize | ( | void | ) | const |
Returns the horizontal scrollbar step size as a fraction of one complete view page.
References d_horzStep.
Scrollbar * CEGUI::ScrollablePane::getHorzScrollbar | ( | ) | const |
Return a pointer to the horizontal scrollbar component widget for this ScrollablePane.
UnknownObjectException | Thrown if the horizontal Scrollbar component does not exist. |
References CEGUI::Window::getName(), and HorzScrollbarNameSuffix.
Referenced by configureScrollbars(), getHorizontalScrollPosition(), CEGUI::FalagardScrollablePane::getViewableArea(), handleContentAreaChange(), initialiseComponents(), onMouseWheel(), setHorizontalScrollPosition(), and updateContainerPosition().
ScrolledContainer * CEGUI::ScrollablePane::getScrolledContainer | ( | ) | const [protected] |
Return a pointer to the ScrolledContainer component widget for this ScrollablePane.
UnknownObjectException | Thrown if the scrolled container component does not exist. |
References CEGUI::Window::getName(), and ScrolledContainerNameSuffix.
Referenced by addChild_impl(), getContentPane(), getContentPaneArea(), handleContentAreaChange(), initialiseComponents(), isContentPaneAutoSized(), removeChild_impl(), setContentPaneArea(), setContentPaneAutoSized(), and updateContainerPosition().
float CEGUI::ScrollablePane::getVerticalOverlapSize | ( | void | ) | const |
Returns the vertical scrollbar overlap size as a fraction of one complete view page.
References d_vertOverlap.
float CEGUI::ScrollablePane::getVerticalScrollPosition | ( | void | ) | const |
Returns the vertical scroll position as a fraction of the complete scrollable height.
References CEGUI::Scrollbar::getDocumentSize(), CEGUI::Scrollbar::getScrollPosition(), and getVertScrollbar().
float CEGUI::ScrollablePane::getVerticalStepSize | ( | void | ) | const |
Returns the vertical scrollbar step size as a fraction of one complete view page.
References d_vertStep.
Scrollbar * CEGUI::ScrollablePane::getVertScrollbar | ( | ) | const |
Return a pointer to the vertical scrollbar component widget for this ScrollablePane.
UnknownObjectException | Thrown if the vertical Scrollbar component does not exist. |
References CEGUI::Window::getName(), and VertScrollbarNameSuffix.
Referenced by configureScrollbars(), getVerticalScrollPosition(), CEGUI::FalagardScrollablePane::getViewableArea(), handleContentAreaChange(), initialiseComponents(), onMouseWheel(), setVerticalScrollPosition(), and updateContainerPosition().
Rect CEGUI::ScrollablePane::getViewableArea | ( | void | ) | const |
Return a Rect that described the pane's viewable area, relative to this Window, in pixels.
References CEGUI::Window::d_windowRenderer, and CEGUI::ScrollablePaneWindowRenderer::getViewableArea().
Referenced by configureScrollbars(), isHorzScrollbarNeeded(), and isVertScrollbarNeeded().
void CEGUI::ScrollablePane::initialiseComponents | ( | void | ) | [virtual] |
Initialises the Window based object ready for use.
Reimplemented from CEGUI::Window.
References configureScrollbars(), d_autoSizeChangedConn, d_contentChangedConn, CEGUI::ScrolledContainer::EventAutoSizeSettingChanged, CEGUI::ScrolledContainer::EventContentChanged, CEGUI::Scrollbar::EventScrollPositionChanged, getHorzScrollbar(), getScrolledContainer(), getVertScrollbar(), handleAutoSizePaneChanged(), handleContentAreaChange(), handleScrollChange(), CEGUI::Window::setAlwaysOnTop(), CEGUI::Window::setSize(), and CEGUI::EventSet::subscribeEvent().
bool CEGUI::ScrollablePane::isContentPaneAutoSized | ( | void | ) | const |
Return whether the content pane is auto sized.
References getScrolledContainer(), and CEGUI::ScrolledContainer::isContentPaneAutoSized().
bool CEGUI::ScrollablePane::isHorzScrollbarAlwaysShown | ( | void | ) | const |
Return whether the horizontal scroll bar is always shown.
References d_forceHorzScroll.
bool CEGUI::ScrollablePane::isHorzScrollbarNeeded | ( | void | ) | const [protected] |
Return whether the horizontal scrollbar is needed.
References d_contentRect, d_forceHorzScroll, getViewableArea(), and CEGUI::Rect::getWidth().
Referenced by configureScrollbars().
bool CEGUI::ScrollablePane::isVertScrollbarAlwaysShown | ( | void | ) | const |
Return whether the vertical scroll bar is always shown.
References d_forceVertScroll.
bool CEGUI::ScrollablePane::isVertScrollbarNeeded | ( | void | ) | const [protected] |
Return whether the vertical scrollbar is needed.
References d_contentRect, d_forceVertScroll, CEGUI::Rect::getHeight(), and getViewableArea().
Referenced by configureScrollbars().
void CEGUI::ScrollablePane::onAutoSizeSettingChanged | ( | WindowEventArgs & | e | ) | [protected, virtual] |
Notification method called whenever the setting that controls whether the content pane is automatically sized is changed.
e | WindowEventArgs object. |
References EventAutoSizeSettingChanged, EventNamespace, and CEGUI::EventSet::fireEvent().
void CEGUI::ScrollablePane::onContentPaneChanged | ( | WindowEventArgs & | e | ) | [protected, virtual] |
Event trigger method called when some pane content has changed size or location.
e | WindowEventArgs object. |
References EventContentPaneChanged, EventNamespace, and CEGUI::EventSet::fireEvent().
Referenced by handleContentAreaChange().
void CEGUI::ScrollablePane::onContentPaneScrolled | ( | WindowEventArgs & | e | ) | [protected, virtual] |
Notification method called whenever the content pane is scrolled via changes in the scrollbar positions.
e | WindowEventArgs object. |
References EventContentPaneScrolled, EventNamespace, CEGUI::EventSet::fireEvent(), and updateContainerPosition().
Referenced by handleScrollChange().
void CEGUI::ScrollablePane::onHorzScrollbarModeChanged | ( | WindowEventArgs & | e | ) | [protected, virtual] |
Event trigger method called when the setting that controls whether the horizontal scrollbar is always shown or not, is changed.
e | WindowEventArgs object. |
References EventHorzScrollbarModeChanged, EventNamespace, and CEGUI::EventSet::fireEvent().
Referenced by setShowHorzScrollbar().
void CEGUI::ScrollablePane::onMouseWheel | ( | MouseEventArgs & | e | ) | [protected, virtual] |
Handler called when the mouse wheel (z-axis) position changes within this window's area.
e | MouseEventArgs object. All fields are valid. |
Reimplemented from CEGUI::Window.
References CEGUI::Scrollbar::getDocumentSize(), getHorzScrollbar(), CEGUI::Scrollbar::getPageSize(), CEGUI::Scrollbar::getScrollPosition(), CEGUI::Scrollbar::getStepSize(), getVertScrollbar(), CEGUI::EventArgs::handled, CEGUI::Window::isVisible(), CEGUI::Scrollbar::setScrollPosition(), and CEGUI::MouseEventArgs::wheelChange.
void CEGUI::ScrollablePane::onSized | ( | WindowEventArgs & | e | ) | [protected, virtual] |
Handler called when the window's size changes.
e | WindowEventArgs object whose 'window' pointer field is set to the window that triggered the event. For this event the trigger window is always 'this'. |
Reimplemented from CEGUI::Window.
References configureScrollbars(), CEGUI::EventArgs::handled, and updateContainerPosition().
void CEGUI::ScrollablePane::onVertScrollbarModeChanged | ( | WindowEventArgs & | e | ) | [protected, virtual] |
Event trigger method called when the setting that controls whether the vertical scrollbar is always shown or not, is changed.
e | WindowEventArgs object. |
References EventNamespace, EventVertScrollbarModeChanged, and CEGUI::EventSet::fireEvent().
Referenced by setShowVertScrollbar().
void CEGUI::ScrollablePane::setContentPaneArea | ( | const Rect & | area | ) |
Set the current content pane area for the ScrollablePane.
area | Rect object that details the pixel extents to use for the content pane attached to this ScrollablePane. |
References getScrolledContainer(), and CEGUI::ScrolledContainer::setContentArea().
void CEGUI::ScrollablePane::setContentPaneAutoSized | ( | bool | setting | ) |
Set whether the content pane should be auto-sized.
setting |
|
References getScrolledContainer(), and CEGUI::ScrolledContainer::setContentPaneAutoSized().
void CEGUI::ScrollablePane::setHorizontalOverlapSize | ( | float | overlap | ) |
Sets the horizontal scrollbar overlap size as a fraction of one complete view page.
overlap | float value specifying the overlap size, where 1.0f would be the width of the viewing area. |
References configureScrollbars(), and d_horzOverlap.
void CEGUI::ScrollablePane::setHorizontalScrollPosition | ( | float | position | ) |
Sets the horizontal scroll position as a fraction of the complete scrollable width.
position | float value specifying the new scroll position. |
References CEGUI::Scrollbar::getDocumentSize(), getHorzScrollbar(), and CEGUI::Scrollbar::setScrollPosition().
void CEGUI::ScrollablePane::setHorizontalStepSize | ( | float | step | ) |
Sets the horizontal scrollbar step size as a fraction of one complete view page.
step | float value specifying the step size, where 1.0f would be the width of the viewing area. |
References configureScrollbars(), and d_horzStep.
void CEGUI::ScrollablePane::setShowHorzScrollbar | ( | bool | setting | ) |
Set whether the horizontal scroll bar should always be shown.
setting |
|
References configureScrollbars(), d_forceHorzScroll, and onHorzScrollbarModeChanged().
void CEGUI::ScrollablePane::setShowVertScrollbar | ( | bool | setting | ) |
Set whether the vertical scroll bar should always be shown.
setting |
|
References configureScrollbars(), d_forceVertScroll, and onVertScrollbarModeChanged().
void CEGUI::ScrollablePane::setVerticalOverlapSize | ( | float | overlap | ) |
Sets the vertical scrollbar overlap size as a fraction of one complete view page.
overlap | float value specifying the overlap size, where 1.0f would be the height of the viewing area. |
References configureScrollbars(), and d_vertOverlap.
void CEGUI::ScrollablePane::setVerticalScrollPosition | ( | float | position | ) |
Sets the vertical scroll position as a fraction of the complete scrollable height.
position | float value specifying the new scroll position. |
References CEGUI::Scrollbar::getDocumentSize(), getVertScrollbar(), and CEGUI::Scrollbar::setScrollPosition().
void CEGUI::ScrollablePane::setVerticalStepSize | ( | float | step | ) |
Sets the vertical scrollbar step size as a fraction of one complete view page.
step | float value specifying the step size, where 1.0f would be the height of the viewing area. |
References configureScrollbars(), and d_vertStep.
virtual bool CEGUI::ScrollablePane::testClassName_impl | ( | const String & | class_name | ) | const [inline, protected, virtual] |
Return whether this window was inherited from the given class name at some point in the inheritance hierarchy.
class_name | The class name that is to be checked. |
Reimplemented from CEGUI::Window.
References CEGUI::Window::testClassName_impl().
virtual bool CEGUI::ScrollablePane::validateWindowRenderer | ( | const String & | name | ) | const [inline, protected, virtual] |
Function used in checking if a WindowRenderer is valid for this window.
Reimplemented from CEGUI::Window.