[56] | 1 | /* |
---|
| 2 | * Abuse - dark 2D side-scrolling platform game |
---|
| 3 | * Copyright (c) 1995 Crack dot Com |
---|
| 4 | * |
---|
| 5 | * This software was released into the Public Domain. As with most public |
---|
| 6 | * domain software, no warranty is made or implied by Crack dot Com or |
---|
| 7 | * Jonathan Clark. |
---|
| 8 | */ |
---|
| 9 | |
---|
[2] | 10 | #ifndef __GUI_HPP_ |
---|
| 11 | #define __GUI_HPP_ |
---|
| 12 | #include "jwindow.hpp" |
---|
| 13 | |
---|
| 14 | |
---|
| 15 | class ico_button : public ifield |
---|
| 16 | { |
---|
| 17 | int up,act,u,d,ua,da; // up, down, up active, down active |
---|
| 18 | int activate_id; // sent when if not -1 when object receives a draw actove |
---|
| 19 | char key[16]; |
---|
| 20 | public : |
---|
[39] | 21 | ico_button(int X, int Y, int ID, int Up, int down, int upa, int downa, ifield *Next, int act_id=-1, char const *help_key=NULL); |
---|
[2] | 22 | |
---|
| 23 | virtual void area(int &x1, int &y1, int &x2, int &y2, window_manager *wm); |
---|
| 24 | virtual void draw_first(image *screen, window_manager *wm) { draw(0,screen,wm); } |
---|
| 25 | virtual void draw(int active, image *screen, window_manager *wm); |
---|
| 26 | virtual void handle_event(event &ev, image *screen, window_manager *wm, input_manager *im); |
---|
| 27 | |
---|
| 28 | virtual char *read() { return (char *)&up; } |
---|
| 29 | void set_xy(int X, int Y) { x=X; y=Y; } |
---|
| 30 | int X() { return x; } |
---|
| 31 | int Y() { return y; } |
---|
| 32 | int status() { return up; } |
---|
| 33 | void set_act_id(int id); |
---|
| 34 | } ; |
---|
| 35 | |
---|
| 36 | class ico_switch_button : public ifield |
---|
| 37 | { |
---|
| 38 | ifield *blist,*cur_but; |
---|
| 39 | int act; |
---|
| 40 | public : |
---|
| 41 | ico_switch_button(int X, int Y, int ID, int start_on, ifield *butts, ifield *Next); |
---|
| 42 | virtual void area(int &x1, int &y1, int &x2, int &y2, window_manager *wm); |
---|
| 43 | virtual void draw_first(image *screen, window_manager *wm) { cur_but->draw_first(screen,wm); } |
---|
| 44 | virtual void draw(int active, image *screen, window_manager *wm) { cur_but->draw(active,screen,wm); act=active; } |
---|
| 45 | virtual void handle_event(event &ev, image *screen, window_manager *wm, input_manager *im); |
---|
| 46 | virtual ifield *unlink(int id); |
---|
| 47 | virtual char *read() { return cur_but->read(); } |
---|
| 48 | ~ico_switch_button(); |
---|
| 49 | } ; |
---|
| 50 | |
---|
| 51 | #endif |
---|
| 52 | |
---|
| 53 | |
---|