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

Last change on this file since 682 was 659, checked in by Sam Hocevar, 8 years ago

imlib: rename Jwindow's x and y members to m_pos.

  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *  Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
5 *
6 *  This software was released into the Public Domain. As with most public
7 *  domain software, no warranty is made or implied by Crack dot Com, by
8 *  Jonathan Clark, or by Sam Hocevar.
9 */
10
11#ifndef __GUI_HPP_
12#define __GUI_HPP_
13#include "jwindow.h"
14
15
16class ico_button : public ifield
17{
18  int up,act,u,d,ua,da;  // up, down, up active, down active
19  int activate_id;         // sent when if not -1 when object receives a draw actove
20  char key[16];
21public :
22  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);
23
24  virtual void area(int &x1, int &y1, int &x2, int &y2);
25  virtual void draw_first(image *screen) { draw(0,screen); }
26  virtual void draw(int active, image *screen);
27  virtual void handle_event(Event &ev, image *screen, InputManager *im);
28
29  virtual char *read() { return (char *)&up; }
30  int status() { return up; }
31  void set_act_id(int id);
32} ;
33
34class ico_switch_button : public ifield
35{
36  ifield *blist,*cur_but;
37  int act;
38  public :
39  ico_switch_button(int X, int Y, int ID, int start_on, ifield *butts, ifield *Next);
40  virtual void area(int &x1, int &y1, int &x2, int &y2);
41  virtual void draw_first(image *screen) { cur_but->draw_first(screen); }
42  virtual void draw(int active, image *screen) { cur_but->draw(active,screen); act=active; }
43  virtual void handle_event(Event &ev, image *screen, InputManager *im);
44  virtual ifield *unlink(int id);
45  virtual char *read() { return cur_but->read(); }
46  ~ico_switch_button();
47} ;
48
49#endif
50
51
Note: See TracBrowser for help on using the repository browser.