7 #include "pushbutton.h"
11 PushButton::PushButton(uint32 x, uint32 y, bool * st, std::string s):
12 Element(x, y, 16, 16), state(st), inside(false), text(s)
15 state = &internalState;
18 void PushButton::HandleMouseMove(uint32 x, uint32 y)
20 inside = Inside(x, y);
23 void PushButton::HandleMouseButton(uint32 x, uint32 y, bool mouseDown)
25 if (inside && mouseDown)
29 void PushButton::Draw(uint32 offsetX/*= 0*/, uint32 offsetY/*= 0*/)
32 DrawTransparentBitmap(screenBuffer, extents.x + offsetX, extents.y + offsetY, &pbDown);
34 DrawTransparentBitmap(screenBuffer, extents.x + offsetX, extents.y + offsetY, &pbUp);
36 if (text.length() > 0)
37 DrawString(screenBuffer, extents.x + offsetX + 24, extents.y + offsetY, false, "%s", text.c_str());