source: abuse/trunk/src/gui.h @ 489

Last change on this file since 489 was 481, checked in by Sam Hocevar, 10 years ago

Fuck the history, I'm renaming all .hpp files to .h for my own sanity.

  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
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
10#ifndef __GUI_HPP_
11#define __GUI_HPP_
12#include "jwindow.h"
13
14
15class 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];
20public :
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);
22
23  virtual void area(int &x1, int &y1, int &x2, int &y2);
24  virtual void draw_first(image *screen) { draw(0,screen); }
25  virtual void draw(int active, image *screen);
26  virtual void handle_event(event &ev, image *screen, InputManager *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
36class 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);
43  virtual void draw_first(image *screen) { cur_but->draw_first(screen); }
44  virtual void draw(int active, image *screen) { cur_but->draw(active,screen); act=active; }
45  virtual void handle_event(event &ev, image *screen, InputManager *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
Note: See TracBrowser for help on using the repository browser.