#include #include #include "InputLabel.h" #include "constant.h" using namespace std; extern FONT *joystix; void InputLabel::setCaption(const char *desiredCaption) { caption = desiredCaption; } void InputLabel::focus() {} void InputLabel::blur() {} void InputLabel::shift(int xOffset, int yOffset) { x += xOffset; y += yOffset; } bool InputLabel::within(int xTarget, int yTarget) { return xTarget >= x && xTarget < x + strlen(caption) * charWidth && yTarget >= y && yTarget < y + charHeight; } void InputLabel::draw() { textout_ex(canvas, joystix, caption, x, y, color, -1); } void InputLabel::erase() { rectfill(canvas, x, y, x + strlen(caption) * charWidth - 1, y + charHeight - 1, 0); }