Crazy Eddie's GUI System 0.8.7
ScrolledItemListBase.h
1/************************************************************************
2 created: Sat Oct 29 2005
3 author: Tomas Lindquist Olsen
4*************************************************************************/
5/***************************************************************************
6 * Copyright (C) 2004 - 2009 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 _CEGUIScrolledItemListBase_h_
28#define _CEGUIScrolledItemListBase_h_
29
30#include "./ItemListBase.h"
31#include "./Scrollbar.h"
32
33#if defined(_MSC_VER)
34# pragma warning(push)
35# pragma warning(disable : 4251)
36#endif
37// begin CEGUI namespace
38namespace CEGUI
39{
40
45class CEGUIEXPORT ScrolledItemListBase : public ItemListBase
46{
47public:
48 static const String EventNamespace;
49
50 /************************************************************************
51 Constants
52 *************************************************************************/
55 static const String ContentPaneName;
56
69
70 /************************************************************************
71 Accessors
72 *************************************************************************/
77 bool isVertScrollbarAlwaysShown(void) const {return d_forceVScroll;}
78
83 bool isHorzScrollbarAlwaysShown(void) const {return d_forceHScroll;}
84
90
96
97 /************************************************************************
98 Manipulators
99 *************************************************************************/
104 void setShowVertScrollbar(bool mode);
105
110 void setShowHorzScrollbar(bool mode);
111
126
141
142 /************************************************************************
143 Object Construction and Destruction
144 *************************************************************************/
149 ScrolledItemListBase(const String& type, const String& name);
150
156
157 // overridden from ItemListBase
158 virtual void initialiseComponents(void);
159
160protected:
161 /************************************************************************
162 Implementation functions
163 ************************************************************************/
168 void configureScrollbars(const Sizef& doc_size);
169
170 /************************************************************************
171 New event handlers
172 ************************************************************************/
173 virtual void onVertScrollbarModeChanged(WindowEventArgs& e);
174 virtual void onHorzScrollbarModeChanged(WindowEventArgs& e);
175
176 /************************************************************************
177 Overridden event handlers
178 ************************************************************************/
179 virtual void onMouseWheel(MouseEventArgs& e);
180
181 /************************************************************************
182 Event subscribers
183 ************************************************************************/
184 bool handle_VScroll(const EventArgs& e);
185 bool handle_HScroll(const EventArgs& e);
186
187 /************************************************************************
188 Implementation data
189 ************************************************************************/
190 bool d_forceVScroll;
191 bool d_forceHScroll;
192
193private:
194 void addScrolledItemListBaseProperties(void);
195};
196
197} // end CEGUI namespace
198
199#if defined(_MSC_VER)
200# pragma warning(pop)
201#endif
202
203#endif // end of guard _CEGUIScrolledItemListBase_h_
Base class used as the argument to all subscribers Event object.
Definition: EventArgs.h:51
Base class for item type widgets.
Definition: widgets/ItemEntry.h:77
Base class for item list widgets.
Definition: ItemListBase.h:79
EventArgs based class that is used for objects passed to input event handlers concerning mouse input.
Definition: InputEvent.h:281
Base scroll bar class.
Definition: widgets/Scrollbar.h:90
ScrolledItemListBase window class.
Definition: ScrolledItemListBase.h:46
void ensureItemIsVisibleVert(const ItemEntry &item)
Scroll the vertical list position if needed to ensure that the ItemEntry item is, if possible,...
static const String HorzScrollbarName
Name for horizontal scrollbar component.
Definition: ScrolledItemListBase.h:54
static const String EventHorzScrollbarModeChanged
Definition: ScrolledItemListBase.h:68
static const String EventVertScrollbarModeChanged
Definition: ScrolledItemListBase.h:62
bool isVertScrollbarAlwaysShown(void) const
Returns whether the vertical scrollbar is being forced visible. Despite content size.
Definition: ScrolledItemListBase.h:77
void setShowHorzScrollbar(bool mode)
Sets whether the horizontal scrollbar should be forced visible. Despite content size.
static const String EventNamespace
Namespace for global events.
Definition: ScrolledItemListBase.h:48
void setShowVertScrollbar(bool mode)
Sets whether the vertical scrollbar should be forced visible. Despite content size.
static const String ContentPaneName
Name for the content pane component.
Definition: ScrolledItemListBase.h:55
virtual ~ScrolledItemListBase(void)
Destructor for the ScrolledItemListBase base class.
void ensureItemIsVisibleHorz(const ItemEntry &item)
Scroll the horizontal list position if needed to ensure that the ItemEntry item is,...
ScrolledItemListBase(const String &type, const String &name)
Constructor for the ScrolledItemListBase base class constructor.
virtual void initialiseComponents(void)
Initialise the Window based object ready for use.
void configureScrollbars(const Sizef &doc_size)
Configure scrollbars.
bool isHorzScrollbarAlwaysShown(void) const
Returns whether the horizontal scrollbar is being forced visible. Despite content size.
Definition: ScrolledItemListBase.h:83
static const String VertScrollbarName
Name for vertical scrollbar component.
Definition: ScrolledItemListBase.h:53
Scrollbar * getHorzScrollbar() const
Get the horizontal scrollbar component attached to this window.
Scrollbar * getVertScrollbar() const
Get the vertical scrollbar component attached to this window.
virtual void onMouseWheel(MouseEventArgs &e)
Handler called when the mouse wheel (z-axis) position changes within this window's area.
String class used within the GUI system.
Definition: String.h:64
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: InputEvent.h:252
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1