Crazy Eddies GUI System
0.7.8
Main Page
Related Pages
Namespaces
Classes
Files
File List
cegui
include
elements
CEGUISpinner.h
1
/***********************************************************************
2
filename: CEGUISpinner.h
3
created: 3/2/2005
4
author: Paul D Turner
5
*************************************************************************/
6
/***************************************************************************
7
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
8
*
9
* Permission is hereby granted, free of charge, to any person obtaining
10
* a copy of this software and associated documentation files (the
11
* "Software"), to deal in the Software without restriction, including
12
* without limitation the rights to use, copy, modify, merge, publish,
13
* distribute, sublicense, and/or sell copies of the Software, and to
14
* permit persons to whom the Software is furnished to do so, subject to
15
* the following conditions:
16
*
17
* The above copyright notice and this permission notice shall be
18
* included in all copies or substantial portions of the Software.
19
*
20
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26
* OTHER DEALINGS IN THE SOFTWARE.
27
***************************************************************************/
28
#ifndef _CEGUISpinner_h_
29
#define _CEGUISpinner_h_
30
31
#include "../CEGUIBase.h"
32
#include "../CEGUIWindow.h"
33
#include "CEGUISpinnerProperties.h"
34
35
#if defined(_MSC_VER)
36
# pragma warning(push)
37
# pragma warning(disable : 4251)
38
#endif
39
40
41
// Start of CEGUI namespace section
42
namespace
CEGUI
43
{
52
class
CEGUIEXPORT
Spinner
:
public
Window
53
{
54
public
:
59
enum
TextInputMode
60
{
61
FloatingPoint
,
62
Integer
,
63
Hexadecimal
,
64
Octal
65
};
66
67
/*************************************************************************
68
Events system constants
69
*************************************************************************/
70
static
const
String
WidgetTypeName
;
71
static
const
String
EventNamespace
;
72
77
static
const
String
EventValueChanged
;
83
static
const
String
EventStepChanged
;
89
static
const
String
EventMaximumValueChanged
;
95
static
const
String
EventMinimumValueChanged
;
101
static
const
String
EventTextInputModeChanged
;
102
103
/*************************************************************************
104
Component widget name suffix strings
105
*************************************************************************/
106
static
const
String
EditboxNameSuffix
;
107
static
const
String
IncreaseButtonNameSuffix
;
108
static
const
String
DecreaseButtonNameSuffix
;
109
110
/*************************************************************************
111
Object Construction and Destruction
112
*************************************************************************/
117
Spinner
(
const
String
& type,
const
String
& name);
118
123
virtual
~
Spinner
(
void
);
124
135
void
initialiseComponents(
void
);
136
137
138
/*************************************************************************
139
Accessors
140
*************************************************************************/
148
double
getCurrentValue(
void
)
const
;
149
158
double
getStepSize(
void
)
const
;
159
167
double
getMaximumValue(
void
)
const
;
168
176
double
getMinimumValue(
void
)
const
;
177
186
TextInputMode
getTextInputMode(
void
)
const
;
187
188
/*************************************************************************
189
Manipulators
190
*************************************************************************/
201
void
setCurrentValue(
double
value);
202
214
void
setStepSize(
double
step);
215
226
void
setMaximumValue(
double
maxValue);
227
238
void
setMinimumValue(
double
minVaue);
239
251
void
setTextInputMode(
TextInputMode
mode);
252
253
protected
:
254
/*************************************************************************
255
Constants
256
*************************************************************************/
257
static
const
String
FloatValidator
;
258
static
const
String
IntegerValidator
;
259
static
const
String
HexValidator
;
260
static
const
String
OctalValidator
;
261
262
/*************************************************************************
263
Protected Implementation Methods
264
*************************************************************************/
274
virtual
double
getValueFromText(
void
)
const
;
275
283
virtual
String
getTextFromValue(
void
)
const
;
284
285
296
virtual
bool
testClassName_impl(
const
String
& class_name)
const
297
{
298
if
(class_name==
"Spinner"
)
return
true
;
299
return
Window::testClassName_impl
(class_name);
300
}
301
313
PushButton
* getIncreaseButton()
const
;
314
326
PushButton
* getDecreaseButton()
const
;
327
338
Editbox
* getEditbox()
const
;
339
340
/*************************************************************************
341
Overrides for Event handler methods
342
*************************************************************************/
343
virtual
void
onFontChanged(
WindowEventArgs
& e);
344
virtual
void
onTextChanged(
WindowEventArgs
& e);
345
virtual
void
onActivated(
ActivationEventArgs
& e);
346
347
/*************************************************************************
348
New Event handler methods
349
*************************************************************************/
360
virtual
void
onValueChanged(
WindowEventArgs
& e);
361
372
virtual
void
onStepChanged(
WindowEventArgs
& e);
373
384
virtual
void
onMaximumValueChanged(
WindowEventArgs
& e);
385
396
virtual
void
onMinimumValueChanged(
WindowEventArgs
& e);
397
408
virtual
void
onTextInputModeChanged(
WindowEventArgs
& e);
409
410
/*************************************************************************
411
Internal event listener methods
412
*************************************************************************/
413
bool
handleIncreaseButton(
const
EventArgs
& e);
414
bool
handleDecreaseButton(
const
EventArgs
& e);
415
bool
handleEditTextChange(
const
EventArgs
& e);
416
417
418
/*************************************************************************
419
Data Fields
420
*************************************************************************/
421
double
d_stepSize
;
422
double
d_currentValue
;
423
double
d_maxValue
;
424
double
d_minValue
;
425
TextInputMode
d_inputMode
;
426
427
private
:
428
/*************************************************************************
429
Static properties for the Spinner widget
430
*************************************************************************/
431
static
SpinnerProperties::CurrentValue
d_currentValueProperty;
432
static
SpinnerProperties::StepSize
d_stepSizeProperty;
433
static
SpinnerProperties::MaximumValue
d_maxValueProperty;
434
static
SpinnerProperties::MinimumValue
d_minValueProperty;
435
static
SpinnerProperties::TextInputMode
d_textInputModeProperty;
436
437
/*************************************************************************
438
Private Implementation Methods
439
*************************************************************************/
447
void
addSpinnerProperties(
void
);
448
};
449
450
}
// End of CEGUI namespace section
451
452
#if defined(_MSC_VER)
453
# pragma warning(pop)
454
#endif
455
456
#endif // end of guard _CEGUISpinner_h_
Generated by
1.8.3.1