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 |
|
---|
14 | class i4_graphical_style_class;
|
---|
15 | class i4_event_handler_class;
|
---|
16 |
|
---|
17 | #include "device/event.hh"
|
---|
18 | #include "window/window.hh"
|
---|
19 |
|
---|
20 | class i4_slider_event : public i4_object_message_event_class
|
---|
21 | {
|
---|
22 | public:
|
---|
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 |
|
---|
30 | class 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 |
|
---|
44 | public:
|
---|
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
|
---|