7 #include "slideswitch.h"
11 SlideSwitch::SlideSwitch(uint32 x, uint32 y, bool * st, std::string s1, std::string s2):
12 Element(x, y, 16, 32), state(st), inside(false), text1(s1), text2(s2)
16 void SlideSwitch::HandleMouseMove(uint32 x, uint32 y)
18 inside = Inside(x, y);
21 void SlideSwitch::HandleMouseButton(uint32 x, uint32 y, bool mouseDown)
23 if (inside && mouseDown)
29 void SlideSwitch::Draw(uint32 offsetX/*= 0*/, uint32 offsetY/*= 0*/)
31 DrawTransparentBitmapDeprecated(screenBuffer, extents.x + offsetX, extents.y + offsetY, (*state ? slideSwitchDown : slideSwitchUp));
33 if (text1.length() > 0)
34 DrawString(screenBuffer, extents.x + offsetX + 24, extents.y + offsetY, false, "%s", text1.c_str());
36 if (text2.length() > 0)
37 DrawString(screenBuffer, extents.x + offsetX + 24, extents.y + offsetY + 16, false, "%s", text2.c_str());