X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fslideswitch.cpp;fp=src%2Fgui%2Fslideswitch.cpp;h=0000000000000000000000000000000000000000;hb=94e1e961b57f253b760298ab0bae96a7de6d20fa;hp=fcf05201ef67c25574a3d5a6436986922bdedba8;hpb=f95620384355f3db89f779e1e7be59260ecfc6ff;p=virtualjaguar diff --git a/src/gui/slideswitch.cpp b/src/gui/slideswitch.cpp deleted file mode 100644 index fcf0520..0000000 --- a/src/gui/slideswitch.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// -// SlideSwitch class -// -// by James L. Hammons -// - -#include "slideswitch.h" - -#include "guimisc.h" - -SlideSwitch::SlideSwitch(uint32 x, uint32 y, bool * st, std::string s1, std::string s2): - Element(x, y, 16, 32), state(st), inside(false), text1(s1), text2(s2) -{ -} - -void SlideSwitch::HandleMouseMove(uint32 x, uint32 y) -{ - inside = Inside(x, y); -} - -void SlideSwitch::HandleMouseButton(uint32 x, uint32 y, bool mouseDown) -{ - if (inside && mouseDown) - { - *state = !(*state); - } -} - -void SlideSwitch::Draw(uint32 offsetX/*= 0*/, uint32 offsetY/*= 0*/) -{ - DrawTransparentBitmapDeprecated(screenBuffer, extents.x + offsetX, extents.y + offsetY, (*state ? slideSwitchDown : slideSwitchUp)); - - if (text1.length() > 0) - DrawString(screenBuffer, extents.x + offsetX + 24, extents.y + offsetY, false, "%s", text1.c_str()); - - if (text2.length() > 0) - DrawString(screenBuffer, extents.x + offsetX + 24, extents.y + offsetY + 16, false, "%s", text2.c_str()); -}