original 1.0.1 release
[xwelltris.git] / src / include / wellswitch.h
blob30deef8b6ef2821add09846d696b4268e03174e1
1 #ifndef WELLSWITCH_H
2 #define WELLSWITCH_H
4 #include "wellobject.h"
6 enum SwitchMode { OnlySet, OnlyReset, SetReset};
8 class WellSwitch: public WellObject
10 protected:
11 ObjectCaller object_on_switch;
12 bool highlighted;
13 bool value;
14 SwitchMode mode;
16 bool press(int mx, int my);
17 bool highlight(int mx, int my);
19 public:
20 WellSwitch(char* keyname);
21 void set_object_on_switch(ObjectCaller o) { object_on_switch=o;};
22 virtual bool process_event(wEvent);
23 virtual void show();
24 virtual void hide();
25 virtual void redraw();
26 void set_value(bool v) { value=v; if(shown) redraw();};
27 bool get_value() { return value;};
28 void set_mode(SwitchMode m) { mode=m;};
31 #endif