Crazy Eddie's GUI System 0.8.7
Loading...
Searching...
No Matches
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
39namespace CEGUI
40{
43{
44public:
47
56 virtual Rectf getViewableArea(void) const = 0;
57};
58
74class CEGUIEXPORT ScrollablePane : public Window
75{
76public:
78 static const String WidgetTypeName;
80 static const String EventNamespace;
116
118 ScrollablePane(const String& type, const String& name);
119
122
123 virtual int writeChildWindowsXML(XMLSerializer& xml_stream) const;
124
138
148
170
180
202
212 bool isContentPaneAutoSized(void) const;
213
234
243 const Rectf& getContentPaneArea(void) const;
244
261
271 float getHorizontalStepSize(void) const;
272
285 void setHorizontalStepSize(float step);
286
296 float getHorizontalOverlapSize(void) const;
297
311
321
333 void setHorizontalScrollPosition(float position);
334
344 float getVerticalStepSize(void) const;
345
358 void setVerticalStepSize(float step);
359
369 float getVerticalOverlapSize(void) const;
370
384
393 float getVerticalScrollPosition(void) const;
394
406 void setVerticalScrollPosition(float position);
407
417
430
443
444 // Overridden from Window
446 void destroy(void);
447
448protected:
456
465 bool isVertScrollbarNeeded(void) const;
466
475 bool isHorzScrollbarNeeded(void) const;
476
483
496
497 // validate window renderer
499
500 /*************************************************************************
501 Event triggers
502 *************************************************************************/
515
528
541
554
567
568 /*************************************************************************
569 Event handler methods
570 *************************************************************************/
577
584
591
592 // Overridden from Window
593 void addChild_impl(Element* element);
594 void removeChild_impl(Element* element);
595
598
601
620
621private:
622 void addScrollablePaneProperties(void);
623};
624
625} // End of CEGUI namespace section
626
627#if defined(_MSC_VER)
628# pragma warning(pop)
629#endif
630
631#endif // end of guard _CEGUIScrollablePane_h_
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition Element.h:211
A positioned and sized rectangular node in a tree graph.
Definition Element.h:246
Base class used as the argument to all subscribers Event object.
Definition EventArgs.h:51
EventArgs based class that is used for objects passed to input event handlers concerning mouse input.
Definition InputEvent.h:281
Adds name to the Element class, including name path traversal.
Definition NamedElement.h:76
Base class for ScrollablePane window renderer objects.
Definition widgets/ScrollablePane.h:43
ScrollablePaneWindowRenderer(const String &name)
Constructor.
virtual Rectf getViewableArea(void) const =0
Return a Rect that described the pane's viewable area, relative to this Window, in pixels.
Base class for the ScrollablePane widget.
Definition widgets/ScrollablePane.h:75
Event::Connection d_autoSizeChangedConn
Event connection to content pane.
Definition widgets/ScrollablePane.h:619
void setContentPaneAutoSized(bool setting)
Set whether the content pane should be auto-sized.
static const String HorzScrollbarName
Widget name for the horizontal scrollbar component.
Definition widgets/ScrollablePane.h:113
virtual void onHorzScrollbarModeChanged(WindowEventArgs &e)
Event trigger method called when the setting that controls whether the horizontal scrollbar is always...
void setHorizontalOverlapSize(float overlap)
Sets the horizontal scrollbar overlap size as a fraction of one complete view page.
void initialiseComponents(void)
Initialises the Window based object ready for use.
bool isContentPaneAutoSized(void) const
Return whether the content pane is auto sized.
void setHorizontalStepSize(float step)
Sets the horizontal scrollbar step size as a fraction of one complete view page.
float d_horzStep
horizontal scroll step fraction.
Definition widgets/ScrollablePane.h:613
void setVerticalScrollPosition(float position)
Sets the vertical scroll position as a fraction of the complete scrollable height.
static const String VertScrollbarName
Widget name for the vertical scrollbar component.
Definition widgets/ScrollablePane.h:111
float d_vertStep
vertical scroll step fraction.
Definition widgets/ScrollablePane.h:609
bool d_forceHorzScroll
true if horizontal scrollbar should always be displayed
Definition widgets/ScrollablePane.h:605
virtual bool validateWindowRenderer(const WindowRenderer *renderer) const
Function used in checking if a WindowRenderer is valid for this window.
void setShowVertScrollbar(bool setting)
Set whether the vertical scroll bar should always be shown.
float getHorizontalScrollPosition(void) const
Returns the horizontal scroll position as a fraction of the complete scrollable width.
~ScrollablePane(void)
Destructor for the ScrollablePane base class.
bool d_forceVertScroll
true if vertical scrollbar should always be displayed
Definition widgets/ScrollablePane.h:603
void setContentPaneArea(const Rectf &area)
Set the current content pane area for the ScrollablePane.
void setShowHorzScrollbar(bool setting)
Set whether the horizontal scroll bar should always be shown.
Event::Connection d_contentChangedConn
Event connection to content pane.
Definition widgets/ScrollablePane.h:617
float getVerticalOverlapSize(void) const
Returns the vertical scrollbar overlap size as a fraction of one complete view page.
Scrollbar * getHorzScrollbar() const
Return a pointer to the horizontal scrollbar component widget for this ScrollablePane.
ScrollablePane(const String &type, const String &name)
Constructor for the ScrollablePane base class.
void updateContainerPosition(void)
Update the content container position according to the current state of the widget (like scrollbar po...
Rectf d_contentRect
holds content area so we can track changes.
Definition widgets/ScrollablePane.h:607
virtual void onVertScrollbarModeChanged(WindowEventArgs &e)
Event trigger method called when the setting that controls whether the vertical scrollbar is always s...
virtual void onContentPaneScrolled(WindowEventArgs &e)
Notification method called whenever the content pane is scrolled via changes in the scrollbar positio...
float getHorizontalOverlapSize(void) const
Returns the horizontal scrollbar overlap size as a fraction of one complete view page.
bool handleScrollChange(const EventArgs &e)
Handler method which gets subscribed to the scrollbar position change events.
void setHorizontalScrollPosition(float position)
Sets the horizontal scroll position as a fraction of the complete scrollable width.
static const String EventVertScrollbarModeChanged
Definition widgets/ScrollablePane.h:92
void setVerticalStepSize(float step)
Sets the vertical scrollbar step size as a fraction of one complete view page.
const ScrolledContainer * getContentPane(void) const
Returns a pointer to the window holding the pane contents.
static const String EventHorzScrollbarModeChanged
Definition widgets/ScrollablePane.h:98
virtual void onContentPaneChanged(WindowEventArgs &e)
Event trigger method called when some pane content has changed size or location.
void destroy(void)
Internal destroy method which actually just adds the window and any parent destructed child windows t...
bool isHorzScrollbarAlwaysShown(void) const
Return whether the horizontal scroll bar is always shown.
Rectf getViewableArea(void) const
Return a Rect that described the pane's viewable area, relative to this Window, in pixels.
static const String WidgetTypeName
Window factory name.
Definition widgets/ScrollablePane.h:78
const Rectf & getContentPaneArea(void) const
Return the current content pane area for the ScrollablePane.
void removeChild_impl(Element *element)
Remove given element from child list.
float getHorizontalStepSize(void) const
Returns the horizontal scrollbar step size as a fraction of one complete view page.
static const String EventContentPaneChanged
Definition widgets/ScrollablePane.h:86
static const String EventContentPaneScrolled
Definition widgets/ScrollablePane.h:109
bool isVertScrollbarAlwaysShown(void) const
Return whether the vertical scroll bar is always shown.
ScrolledContainer * getScrolledContainer() const
Return a pointer to the ScrolledContainer component widget for this ScrollablePane.
void onMouseWheel(MouseEventArgs &e)
Handler called when the mouse wheel (z-axis) position changes within this window's area.
static const String EventAutoSizeSettingChanged
Definition widgets/ScrollablePane.h:104
static const String ScrolledContainerName
Widget name for the scrolled container component.
Definition widgets/ScrollablePane.h:115
void addChild_impl(Element *element)
Add given element to child list at an appropriate position.
bool isHorzScrollbarNeeded(void) const
Return whether the horizontal scrollbar is needed.
void configureScrollbars(void)
display required integrated scroll bars according to current size of the ScrollablePane view area and...
bool handleAutoSizePaneChanged(const EventArgs &e)
Handler method which gets subscribed to the ScrolledContainer auto-size setting changes.
float d_vertOverlap
vertical scroll overlap fraction.
Definition widgets/ScrollablePane.h:611
void onSized(ElementEventArgs &e)
Handler called when the window's size changes.
float getVerticalScrollPosition(void) const
Returns the vertical scroll position as a fraction of the complete scrollable height.
void setVerticalOverlapSize(float overlap)
Sets the vertical scrollbar overlap size as a fraction of one complete view page.
bool handleContentAreaChange(const EventArgs &e)
Handler method which gets subscribed to the ScrolledContainer content change events.
float getVerticalStepSize(void) const
Returns the vertical scrollbar step size as a fraction of one complete view page.
Scrollbar * getVertScrollbar() const
Return a pointer to the vertical scrollbar component widget for this ScrollablePane.
NamedElement * getChildByNamePath_impl(const String &name_path) const
Retrieves a child at name_path or 0 if none such exists.
bool isVertScrollbarNeeded(void) const
Return whether the vertical scrollbar is needed.
float d_horzOverlap
horizontal scroll overlap fraction.
Definition widgets/ScrollablePane.h:615
static const String EventNamespace
Namespace for global events.
Definition widgets/ScrollablePane.h:80
virtual void onAutoSizeSettingChanged(WindowEventArgs &e)
Notification method called whenever the setting that controls whether the content pane is automatical...
Base scroll bar class.
Definition widgets/Scrollbar.h:90
Helper container window class which is used in the implementation of the ScrollablePane widget class.
Definition ScrolledContainer.h:48
String class used within the GUI system.
Definition String.h:64
base class for properties able to do native set/get
Definition TypedProperty.h:50
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition InputEvent.h:252
Base-class for the assignable WindowRenderer object.
Definition WindowRenderer.h:52
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition Window.h:151
Class used to create XML Document.
Definition XMLSerializer.h:87
Main namespace for Crazy Eddie's GUI Library.
Definition arch_overview.dox:1