X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fbutton.h;h=4b4f1316a758d4cf2d2a6031fd990fe8a32f7509;hb=c0001155bc0909da61f6c849c0be9b16e9b7f4b6;hp=fcf366bbc8ad205d2700bff0368d521738609d45;hpb=b90c77b56b023d274fc028e449227bd0f6f37e8e;p=apple2 diff --git a/src/gui/button.h b/src/gui/button.h index fcf366b..4b4f131 100755 --- a/src/gui/button.h +++ b/src/gui/button.h @@ -8,6 +8,7 @@ #define __BUTTON_H__ #include +//#include #include "element.h" //Apparently this approach doesn't work for inheritance... D'oh! @@ -16,24 +17,27 @@ class Button: public Element { public: - Button(uint32 x = 0, uint32 y = 0, uint32 w = 0, uint32 h = 0, Element * parent = NULL); - Button(uint32 x, uint32 y, uint32 w, uint32 h, SDL_Surface * upImg, Element * parent = NULL); - Button(uint32 x, uint32 y, SDL_Surface * bU, SDL_Surface * bH = NULL, SDL_Surface * bD = NULL, Element * parent = NULL); - Button(uint32 x, uint32 y, uint32 w, uint32 h, std::string s, Element * parent = NULL); - Button(uint32 x, uint32 y, std::string s, Element * parent = NULL); + Button(uint32_t x = 0, uint32_t y = 0, uint32_t w = 0, uint32_t h = 0, Element * parent = NULL); + Button(uint32_t x, uint32_t y, uint32_t w, uint32_t h, SDL_Surface * upImg, Element * parent = NULL); + Button(uint32_t x, uint32_t y, SDL_Surface * bU, SDL_Surface * bH = NULL, SDL_Surface * bD = NULL, Element * parent = NULL); + Button(uint32_t x, uint32_t y, uint32_t w, uint32_t h, std::string s, Element * parent = NULL); + Button(uint32_t x, uint32_t y, std::string s, Element * parent = NULL); ~Button(); - virtual void HandleKey(SDLKey key); - virtual void HandleMouseMove(uint32 x, uint32 y); - virtual void HandleMouseButton(uint32 x, uint32 y, bool mouseDown); + virtual void HandleKey(SDL_Scancode key); + virtual void HandleMouseMove(uint32_t x, uint32_t y); + virtual void HandleMouseButton(uint32_t x, uint32_t y, bool mouseDown); virtual void Draw(void); virtual void Notify(Element *); bool ButtonClicked(void); void SaveStateVariables(void); void CheckStateAndRedrawIfNeeded(void); + void SetText(std::string s); protected: bool activated, clicked, inside; SDL_Surface * buttonUp, * buttonDown, * buttonHover; + uint32_t fgColorHL; + uint32_t bgColorHL; private: bool surfacesAreLocal;