Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Button.h
Go to the documentation of this file.
1
/* Project nGenEx
2
Destroyer Studios LLC
3
Copyright © 1997-2004. All Rights Reserved.
4
5
SUBSYSTEM: nGenEx.lib
6
FILE: Button.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Button class
13
*/
14
15
#ifndef Button_h
16
#define Button_h
17
18
#include "
Types.h
"
19
#include "
ActiveWindow.h
"
20
#include "
Bitmap.h
"
21
22
// +--------------------------------------------------------------------+
23
24
class
Button
:
public
ActiveWindow
25
{
26
public
:
27
enum
SOUNDS
{
28
SND_BUTTON
,
29
SND_CLICK
,
30
SND_SWISH
,
31
SND_CHIRP
,
32
SND_ACCEPT
,
33
SND_REJECT
,
34
SND_CONFIRM
,
35
SND_LIST_SELECT
,
36
SND_LIST_SCROLL
,
37
SND_LIST_DROP
,
38
SND_COMBO_OPEN
,
39
SND_COMBO_CLOSE
,
40
SND_COMBO_HILITE
,
41
SND_COMBO_SELECT
,
42
SND_MENU_OPEN
,
43
SND_MENU_CLOSE
,
44
SND_MENU_SELECT
,
45
SND_MENU_HILITE
46
};
47
48
Button
(
Screen
* s,
int
ax,
int
ay,
int
aw,
int
ah, DWORD
id
=0);
49
Button
(
ActiveWindow
* p,
int
ax,
int
ay,
int
aw,
int
ah, DWORD
id
=0);
50
virtual
~Button
();
51
52
static
void
Initialize
();
53
static
void
Close
();
54
static
void
PlaySound
(
int
n=0);
55
static
void
SetVolume
(
int
vol);
56
57
// Operations:
58
virtual
void
Draw
();
// refresh backing store
59
60
// Event Target Interface:
61
virtual
int
OnMouseMove
(
int
x,
int
y);
62
virtual
int
OnLButtonDown
(
int
x,
int
y);
63
virtual
int
OnLButtonUp
(
int
x,
int
y);
64
virtual
int
OnClick
();
65
virtual
int
OnMouseEnter
(
int
x,
int
y);
66
virtual
int
OnMouseExit
(
int
x,
int
y);
67
68
// Property accessors:
69
Color
GetActiveColor
();
70
void
SetActiveColor
(
Color
c);
71
bool
GetAnimated
();
72
void
SetAnimated
(
bool
bNewValue);
73
short
GetBevelWidth
();
74
void
SetBevelWidth
(
short
nNewValue);
75
bool
GetBorder
();
76
void
SetBorder
(
bool
bNewValue);
77
Color
GetBorderColor
();
78
void
SetBorderColor
(
Color
c);
79
short
GetButtonState
();
80
void
SetButtonState
(
short
nNewValue);
81
bool
GetDropShadow
();
82
void
SetDropShadow
(
bool
bNewValue);
83
void
GetPicture
(
Bitmap
& img);
84
void
SetPicture
(
const
Bitmap
& img);
85
short
GetPictureLocation
();
86
void
SetPictureLocation
(
short
nNewValue);
87
bool
GetSticky
();
88
void
SetSticky
(
bool
bNewValue);
89
90
void
SetStandardImage
(
Bitmap
* img);
91
void
SetActivatedImage
(
Bitmap
* img);
92
void
SetTransitionImage
(
Bitmap
* img);
93
94
protected
:
95
Rect
CalcLabelRect
(
int
img_w,
int
img_h);
96
Rect
CalcPictureRect
();
97
void
DrawImage
(
Bitmap
* bmp,
const
Rect
& irect);
98
99
bool
animated
;
100
bool
drop_shadow
;
101
bool
sticky
;
102
bool
border
;
103
104
Color
active_color
;
105
Color
border_color
;
106
107
int
captured
;
108
int
pre_state
;
109
short
bevel_width
;
110
short
button_state
;
111
112
short
picture_loc
;
113
Bitmap
picture
;
114
115
Bitmap
*
standard_image
;
// state = 0
116
Bitmap
*
activated_image
;
// state = 1 (if sticky)
117
Bitmap
*
transition_image
;
// state = 2 (if sticky)
118
};
119
120
#endif Button_h
121
nGenEx
Button.h
Generated on Thu May 31 2012 16:30:52 for Starshatter_Open by
1.8.1