]> Shamusworld >> Repos - virtualjaguar/blob - src/gui/slideswitch.h
Major refactoring of GUI: Phase I
[virtualjaguar] / src / gui / slideswitch.h
1 //
2 // SlideSwitch class
3 //
4 // by James L. Hammons
5 //
6
7 #ifndef __SLIDESWITCH_H__
8 #define __SLIDESWITCH_H__
9
10 #include <string>
11 #include "element.h"
12
13 // How to handle?
14 // Save state externally?
15 #warning Seems to be handled the same as PushButton, but without sanity checks. !!! FIX !!!
16
17 class SlideSwitch: public Element
18 {
19         public:
20                 SlideSwitch(uint32 x, uint32 y, bool * st, std::string s1, std::string s2);
21                 virtual void HandleKey(SDLKey key) {}
22                 virtual void HandleMouseMove(uint32 x, uint32 y);
23                 virtual void HandleMouseButton(uint32 x, uint32 y, bool mouseDown);
24                 virtual void Draw(uint32 offsetX = 0, uint32 offsetY = 0);
25                 virtual void Notify(Element *) {}
26
27         protected:
28                 bool * state;
29                 bool inside;
30                 std::string text1, text2;
31 };
32
33 #endif  // __SLIDESWITCH_H__