Crazy Eddies GUI System
0.6.0
Main Page
Related Pages
Namespaces
Classes
Files
File List
include
elements
CEGUIMenuBase.h
1
/***********************************************************************
2
filename: CEGUIMenuBase.h
3
created: 5/4/2005
4
author: Tomas Lindquist Olsen (based on code by Paul D Turner)
5
6
purpose: Interface to base class for MenuBase widget
7
*************************************************************************/
8
/***************************************************************************
9
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
10
*
11
* Permission is hereby granted, free of charge, to any person obtaining
12
* a copy of this software and associated documentation files (the
13
* "Software"), to deal in the Software without restriction, including
14
* without limitation the rights to use, copy, modify, merge, publish,
15
* distribute, sublicense, and/or sell copies of the Software, and to
16
* permit persons to whom the Software is furnished to do so, subject to
17
* the following conditions:
18
*
19
* The above copyright notice and this permission notice shall be
20
* included in all copies or substantial portions of the Software.
21
*
22
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28
* OTHER DEALINGS IN THE SOFTWARE.
29
***************************************************************************/
30
#ifndef _CEGUIMenuBase_h_
31
#define _CEGUIMenuBase_h_
32
33
#include "CEGUIBase.h"
34
#include "CEGUIWindow.h"
35
#include "elements/CEGUIMenuBaseProperties.h"
36
#include "elements/CEGUIItemListBase.h"
37
38
39
#if defined(_MSC_VER)
40
# pragma warning(push)
41
# pragma warning(disable : 4251)
42
#endif
43
44
45
// Start of CEGUI namespace section
46
namespace
CEGUI
47
{
48
53
class
CEGUIEXPORT
MenuBase
:
public
ItemListBase
54
{
55
public
:
56
static
const
String
EventNamespace
;
57
58
59
/*************************************************************************
60
Event name constants
61
*************************************************************************/
62
// generated internally by Window
63
static
const
String
EventPopupOpened
;
64
static
const
String
EventPopupClosed
;
65
66
67
/*************************************************************************
68
Accessor type functions
69
*************************************************************************/
77
float
getItemSpacing
(
void
)
const
{
return
d_itemSpacing;}
78
79
87
bool
isMultiplePopupsAllowed
(
void
)
const
{
return
d_allowMultiplePopups;}
88
89
97
MenuItem
*
getPopupMenuItem
(
void
)
const
{
return
d_popupItem;}
98
99
100
/*************************************************************************
101
Manipulators
102
*************************************************************************/
107
void
setItemSpacing
(
float
spacing) {d_itemSpacing=spacing; handleUpdatedItemData();}
108
109
117
void
changePopupMenuItem(
MenuItem
* item);
118
119
124
void
setAllowMultiplePopups(
bool
setting);
125
126
127
/*************************************************************************
128
Construction and Destruction
129
*************************************************************************/
134
MenuBase
(
const
String
& type,
const
String
& name);
135
136
141
virtual
~
MenuBase
(
void
);
142
143
144
protected
:
145
/*************************************************************************
146
New Event Handlers
147
*************************************************************************/
152
virtual
void
onPopupOpened(
WindowEventArgs
& e);
153
154
159
virtual
void
onPopupClosed(
WindowEventArgs
& e);
160
161
162
/*************************************************************************
163
Implementation Functions
164
*************************************************************************/
175
virtual
bool
testClassName_impl(
const
String
& class_name)
const
176
{
177
if
(class_name==
"MenuBase"
)
return
true
;
178
return
ItemListBase::testClassName_impl
(class_name);
179
}
180
181
182
/*************************************************************************
183
Implementation Data
184
*************************************************************************/
185
float
d_itemSpacing
;
186
187
MenuItem
*
d_popupItem
;
188
bool
d_allowMultiplePopups
;
189
190
191
private
:
192
/*************************************************************************
193
Static Properties for this class
194
*************************************************************************/
195
static
MenuBaseProperties::ItemSpacing
d_itemSpacingProperty;
196
static
MenuBaseProperties::AllowMultiplePopups
d_allowMultiplePopupsProperty;
197
198
/*************************************************************************
199
Private methods
200
*************************************************************************/
201
void
addMenuBaseProperties(
void
);
202
};
203
204
}
// End of CEGUI namespace section
205
206
207
#if defined(_MSC_VER)
208
# pragma warning(pop)
209
#endif
210
211
#endif // end of guard _CEGUIMenuBase_h_
Generated by
1.8.3.1