Crazy Eddie's GUI System 0.8.7
Loading...
Searching...
No Matches
widgets/ItemEntry.h
1/***********************************************************************
2 created: 31/3/2005
3 author: Tomas Lindquist Olsen (based on code by Paul D Turner)
4
5 purpose: Interface to base class for ItemEntry widget
6*************************************************************************/
7/***************************************************************************
8 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
9 *
10 * Permission is hereby granted, free of charge, to any person obtaining
11 * a copy of this software and associated documentation files (the
12 * "Software"), to deal in the Software without restriction, including
13 * without limitation the rights to use, copy, modify, merge, publish,
14 * distribute, sublicense, and/or sell copies of the Software, and to
15 * permit persons to whom the Software is furnished to do so, subject to
16 * the following conditions:
17 *
18 * The above copyright notice and this permission notice shall be
19 * included in all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
25 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27 * OTHER DEALINGS IN THE SOFTWARE.
28 ***************************************************************************/
29#ifndef _CEGUIItemEntry_h_
30#define _CEGUIItemEntry_h_
31
32#include "../Base.h"
33#include "../Window.h"
34
35#if defined(_MSC_VER)
36# pragma warning(push)
37# pragma warning(disable : 4251)
38#endif
39
40// Start of CEGUI namespace section
41namespace CEGUI
42{
43
48class CEGUIEXPORT ItemEntryWindowRenderer : public WindowRenderer
49{
50public:
56
65 virtual Sizef getItemPixelSize(void) const = 0;
66};
67
76class CEGUIEXPORT ItemEntry : public Window
77{
78public:
79 /*************************************************************************
80 Constants
81 *************************************************************************/
82 static const String WidgetTypeName;
89
90 /*************************************************************************
91 Accessors
92 *************************************************************************/
102
108 ItemListBase* getOwnerList(void) const {return d_ownerList;}
109
114 bool isSelected(void) const {return d_selected;}
115
120 bool isSelectable(void) const {return d_selectable;}
121
122 /*************************************************************************
123 Set methods
124 *************************************************************************/
134 void setSelected(bool setting) {setSelected_impl(setting, true);}
135
140 void select(void) {setSelected_impl(true, true);}
141
146 void deselect(void) {setSelected_impl(false, true);}
147
153 void setSelected_impl(bool state, bool notify);
154
169
170 /*************************************************************************
171 Construction and Destruction
172 *************************************************************************/
177 ItemEntry(const String& type, const String& name);
178
183 virtual ~ItemEntry(void) {}
184
185protected:
186 /*************************************************************************
187 Abstract Implementation Functions
188 *************************************************************************/
197 //virtual Size getItemPixelSize_impl(void) const = 0;
198
199 /*************************************************************************
200 Implementation Functions
201 *************************************************************************/
202 // validate window renderer
204
205 /*************************************************************************
206 New Event Handlers
207 *************************************************************************/
213
214 /*************************************************************************
215 Overridden Event Handlers
216 *************************************************************************/
218
219 /*************************************************************************
220 Implementation Data
221 *************************************************************************/
222
225
228
230 bool d_selectable;
231
232 // make the ItemListBase a friend
233 friend class ItemListBase;
234
235private:
236
237 void addItemEntryProperties(void);
238};
239
240} // End of CEGUI namespace section
241
242#if defined(_MSC_VER)
243# pragma warning(pop)
244#endif
245
246#endif // end of guard _CEGUIItemEntry_h_
Base class for ItemEntry window renderer objects.
Definition widgets/ItemEntry.h:49
ItemEntryWindowRenderer(const String &name)
Constructor.
virtual Sizef getItemPixelSize(void) const =0
Return the "optimal" size for the item.
Base class for item type widgets.
Definition widgets/ItemEntry.h:77
virtual void onSelectionChanged(WindowEventArgs &e)
Handles selection state changes.
bool isSelected(void) const
Returns whether this item is selected or not.
Definition widgets/ItemEntry.h:114
bool isSelectable(void) const
Returns whether this item is selectable or not.
Definition widgets/ItemEntry.h:120
void setSelectable(bool setting)
Sets whether this item will be selectable.
void setSelected(bool setting)
Sets the selection state of this item (on/off). If this item is not selectable this function does not...
Definition widgets/ItemEntry.h:134
Sizef getItemPixelSize(void) const
Return the "optimal" size for the item.
void setSelected_impl(bool state, bool notify)
Set the selection state for this ListItem. Internal version. Should NOT be used by client code.
ItemEntry(const String &type, const String &name)
Constructor for ItemEntry objects.
virtual bool validateWindowRenderer(const WindowRenderer *renderer) const
Return the "optimal" size for the item.
void deselect(void)
Deselects the item.
Definition widgets/ItemEntry.h:146
ItemListBase * d_ownerList
< pointer to the owner ItemListBase. 0 if there is none.
Definition widgets/ItemEntry.h:224
ItemListBase * getOwnerList(void) const
Returns a pointer to the owner ItemListBase. 0 if there is none.
Definition widgets/ItemEntry.h:108
static const String EventSelectionChanged
Definition widgets/ItemEntry.h:88
virtual void onMouseClicked(MouseEventArgs &e)
Handler called when a mouse button has been clicked (that is depressed and then released,...
void select(void)
Selects the item.
Definition widgets/ItemEntry.h:140
virtual ~ItemEntry(void)
Destructor for ItemEntry objects.
Definition widgets/ItemEntry.h:183
static const String WidgetTypeName
Window factory name.
Definition widgets/ItemEntry.h:82
bool d_selected
'true' when the item is selectable.
Definition widgets/ItemEntry.h:227
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
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
Main namespace for Crazy Eddie's GUI Library.
Definition arch_overview.dox:1