X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fpushbutton.cpp;fp=src%2Fgui%2Fpushbutton.cpp;h=0000000000000000000000000000000000000000;hb=94e1e961b57f253b760298ab0bae96a7de6d20fa;hp=738b3ac997ac90e97e6da7f6c6062946b4fcd25f;hpb=f95620384355f3db89f779e1e7be59260ecfc6ff;p=virtualjaguar diff --git a/src/gui/pushbutton.cpp b/src/gui/pushbutton.cpp deleted file mode 100644 index 738b3ac..0000000 --- a/src/gui/pushbutton.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// -// PushButton class -// -// by James L. Hammons -// - -#include "pushbutton.h" - -#include "guimisc.h" - -PushButton::PushButton(uint32 x, uint32 y, bool * st, std::string s): - Element(x, y, 16, 16), state(st), inside(false), text(s) -{ - if (st == NULL) - state = &internalState; -} - -void PushButton::HandleMouseMove(uint32 x, uint32 y) -{ - inside = Inside(x, y); -} - -void PushButton::HandleMouseButton(uint32 x, uint32 y, bool mouseDown) -{ - if (inside && mouseDown) - *state = !(*state); -} - -void PushButton::Draw(uint32 offsetX/*= 0*/, uint32 offsetY/*= 0*/) -{ - if (*state) - DrawTransparentBitmap(screenBuffer, extents.x + offsetX, extents.y + offsetY, &pbDown); - else - DrawTransparentBitmap(screenBuffer, extents.x + offsetX, extents.y + offsetY, &pbUp); - - if (text.length() > 0) - DrawString(screenBuffer, extents.x + offsetX + 24, extents.y + offsetY, false, "%s", text.c_str()); -}