source: golgotha/src/i4/gui/button.hh @ 608

Last change on this file since 608 was 80, checked in by Sam Hocevar, 15 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 2.1 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#ifndef __BUTTON_HPP_
10#define __BUTTON_HPP_
11
12#include "menu/menuitem.hh"
13#include "window/style.hh"
14#include "time/timedev.hh"
15
16class i4_button_class : public i4_menu_item_class
17{
18  protected :
19
20  i4_window_class *decore;
21  i4_bool grabbing;
22  i4_bool repeat_down;
23  i4_bool popup;
24
25  enum { WAIT_CLICK, WAIT_DELAY, WAIT_REPEAT } state;
26  i4_time_device_class::id time_id;
27  i4_event_reaction_class *repeat_event;
28
29  public :
30  char *name() { return "button_class"; }
31  i4_button_class(const i4_const_str *idle_context_help,  // can be null
32                  i4_window_class *child,
33                  i4_graphical_style_class *hint,
34                  i4_event_reaction_class *press=0,
35                  i4_event_reaction_class *depress=0,
36                  i4_event_reaction_class *activate=0,
37                  i4_event_reaction_class *deactivate=0      );
38
39  virtual void reparent(i4_image_class *draw_area, i4_parent_window_class *parent);
40  virtual void receive_event(i4_event *ev);
41  virtual void parent_draw(i4_draw_context_class &context);
42
43  void set_repeat_down(i4_bool value, i4_event_reaction_class *repeat_event=0);
44  void set_popup(i4_bool value);
45   
46  i4_menu_item_class *copy() { return new i4_button_class(context_help,
47                                                          get_nth_window(0),
48                                                          hint,
49                                                          send.press, send.depress,
50                                                          send.activate, send.deactivate); }
51
52  ~i4_button_class();
53} ;
54
55#endif
56
57
Note: See TracBrowser for help on using the repository browser.