]> Shamusworld >> Repos - virtualjaguar/blob - src/gui/button.h
Major refactoring of GUI: Phase I
[virtualjaguar] / src / gui / button.h
1 //
2 // Button class
3 //
4 // by James L. Hammons
5 //
6
7 #ifndef __BUTTON_H__
8 #define __BUTTON_H__
9
10 #include <string>
11 #include "element.h"
12
13 class Button: public Element
14 {
15         public:
16                 Button(uint32 x = 0, uint32 y = 0, uint32 w = 0, uint32 h = 0);
17                 Button(uint32 x, uint32 y, uint32 w, uint32 h, uint32 * p);
18                 Button(uint32 x, uint32 y, uint32 * p, uint32 * pH = NULL, uint32 * pD = NULL);
19                 Button(uint32 x, uint32 y, uint32 w, uint32 h, std::string s);
20                 Button(uint32 x, uint32 y, std::string s);
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                 bool ButtonClicked(void);
27                 void SetNotificationElement(Element * e);
28
29         protected:
30                 bool activated, clicked, inside;
31                 uint32 fgColor, bgColor;
32                 uint32 * pic, * picHover, * picDown;
33                 std::string text;
34                 Element * elementToTell;
35 };
36
37 #endif  // __BUTTON_H__