]> Shamusworld >> Repos - virtualjaguar/blob - src/gui/pushbutton.h
Creating Qt/Experimental branch of trunk.
[virtualjaguar] / src / gui / pushbutton.h
1 //
2 // PushButton class
3 //
4 // by James L. Hammons
5 //
6
7 #ifndef __PUSHBUTTON_H__
8 #define __PUSHBUTTON_H__
9
10 #include <string>
11 #include "element.h"
12
13 // How to handle?
14 // Save state externally?
15 //We pass in a state variable if we want to track it externally, otherwise we use our own
16 //internal state var. Still need to do some kind of callback for pushbuttons that do things
17 //like change from fullscreen to windowed... !!! FIX !!!
18
19 class PushButton: public Element
20 {
21         public:
22                 PushButton(uint32 x, uint32 y, bool * st, std::string s);
23                 virtual void HandleKey(SDLKey key) {}
24                 virtual void HandleMouseMove(uint32 x, uint32 y);
25                 virtual void HandleMouseButton(uint32 x, uint32 y, bool mouseDown);
26                 virtual void Draw(uint32 offsetX = 0, uint32 offsetY = 0);
27                 virtual void Notify(Element *) {}
28
29         protected:
30                 bool * state;
31                 bool inside;
32                 std::string text;
33                 bool internalState;
34 };
35
36 #endif  // __PUSHBUTTON_H__