| 1 |
--- Maelstrom-3.0.6/buttonlist.h.sopwith 2004-06-18 15:33:49.000000000 -0400
|
| 2 |
+++ Maelstrom-3.0.6/buttonlist.h 2004-06-18 15:47:39.000000000 -0400
|
| 3 |
@@ -7,6 +7,13 @@
|
| 4 |
class ButtonList {
|
| 5 |
|
| 6 |
public:
|
| 7 |
+ typedef struct _button {
|
| 8 |
+ /* Sensitive area */
|
| 9 |
+ Uint16 x1, y1;
|
| 10 |
+ Uint16 x2, y2;
|
| 11 |
+ void (*callback)(void);
|
| 12 |
+ struct _button *next;
|
| 13 |
+ } button;
|
| 14 |
ButtonList() {
|
| 15 |
button_list.next = NULL;
|
| 16 |
}
|
| 17 |
@@ -16,7 +23,7 @@
|
| 18 |
|
| 19 |
void Add_Button(Uint16 x, Uint16 y, Uint16 width, Uint16 height,
|
| 20 |
void (*callback)(void)) {
|
| 21 |
- struct button *belem;
|
| 22 |
+ button *belem;
|
| 23 |
|
| 24 |
for ( belem=&button_list; belem->next; belem=belem->next );
|
| 25 |
belem->next = new button;
|
| 26 |
@@ -30,7 +37,7 @@
|
| 27 |
}
|
| 28 |
|
| 29 |
void Activate_Button(Uint16 x, Uint16 y) {
|
| 30 |
- struct button *belem;
|
| 31 |
+ button *belem;
|
| 32 |
|
| 33 |
for ( belem=button_list.next; belem; belem=belem->next ) {
|
| 34 |
if ( (x >= belem->x1) && (x <= belem->x2) &&
|
| 35 |
@@ -42,7 +49,7 @@
|
| 36 |
}
|
| 37 |
|
| 38 |
void Delete_Buttons(void) {
|
| 39 |
- struct button *belem, *btemp;
|
| 40 |
+ button *belem, *btemp;
|
| 41 |
|
| 42 |
for ( belem=button_list.next; belem; ) {
|
| 43 |
btemp = belem;
|
| 44 |
@@ -53,12 +60,5 @@
|
| 45 |
}
|
| 46 |
|
| 47 |
private:
|
| 48 |
- typedef struct button {
|
| 49 |
- /* Sensitive area */
|
| 50 |
- Uint16 x1, y1;
|
| 51 |
- Uint16 x2, y2;
|
| 52 |
- void (*callback)(void);
|
| 53 |
- struct button *next;
|
| 54 |
- } button;
|
| 55 |
button button_list;
|
| 56 |
};
|