source: golgotha/src/i4/gui/slider.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 11 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: 1.8 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 I4_SLIDER_HH
10#define I4_SLIDER_HH
11
12#include "time/timedev.hh"
13
14class i4_graphical_style_class;
15class i4_event_handler_class;
16
17#include "device/event.hh"
18#include "window/window.hh"
19
20class i4_slider_event : public i4_object_message_event_class
21{
22public:
23  w32 x, divisor;
24  i4_slider_event(void *object, w32 x, w32 divisor)
25    : i4_object_message_event_class(object), x(x), divisor(divisor)  {}
26  i4_event *copy() { return new i4_slider_event(object,x,divisor); }
27  char *name() { return "slide event"; }
28};
29
30class i4_slider_class : public i4_window_class
31{
32  i4_graphical_style_class *style;
33  sw32 off, lx,ly;
34  i4_bool grab, active, need_cancel;
35  sw32 bw, milli_delay;                  // button width
36
37 
38  i4_time_device_class::id t_event;
39  i4_event_handler_class *notify;
40
41  void set_off_from_mouse();
42  void send_change();
43
44public:
45  void set_notify(i4_event_handler_class *n) { notify=n; }
46
47  i4_slider_class(sw32 width,
48                  sw32 initial_start,
49                  i4_event_handler_class *notify,
50                  w32 milli_delay,
51                  i4_graphical_style_class *style);
52  ~i4_slider_class();
53
54  void draw(i4_draw_context_class &context);
55  void receive_event(i4_event *ev);
56  char *name() { return "slider"; }
57};
58
59
60#endif
Note: See TracBrowser for help on using the repository browser.