X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fbutton.h;h=4b4f1316a758d4cf2d2a6031fd990fe8a32f7509;hb=f36d026c7b8b398b88765ec5b67a3c767fe5fbad;hp=8009486f0bf6c0c75460f04de218542df32ba91a;hpb=7aa515c76952df63e56229e389023cef44108a5f;p=apple2 diff --git a/src/gui/button.h b/src/gui/button.h old mode 100755 new mode 100644 index 8009486..4b4f131 --- a/src/gui/button.h +++ b/src/gui/button.h @@ -17,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;