2 Copyright 2004-2020 Chris Tallon
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP. If not, see <https://www.gnu.org/licenses/>.
26 setSize(70, 21/*fontHeight*/);
29 void WButton::setText(const char* takeText)
34 void WButton::setActive(UCHAR tactive)
42 // a bolt on for now - an active but dimmed state
51 fillColour(DrawStyle::BLACK);
52 drawTextCentre(mytext.c_str(), area.w / 2, 0, DrawStyle::SELECTHIGHLIGHT);
56 fillColour(DrawStyle::SELECTHIGHLIGHT);
57 drawTextCentre(mytext.c_str(), area.w / 2, 0, DrawStyle::DARKTEXT);
61 fillColour(DrawStyle::BUTTONBACKGROUND);
62 drawTextCentre(mytext.c_str(), area.w / 2, 0, DrawStyle::LIGHTTEXT);
66 void WButton::setTag(int newTag)
76 // Sorry, I've broken these in the boxx upgrade - chris // FIXME so fix it
78 bool WButton::mouseMove(int x, int y)
80 if ( (x - getRootBoxOffsetX()) >= 0
81 && (y - getRootBoxOffsetY()) >= 0
82 && (x - getRootBoxOffsetX()) <= static_cast<int>(area.w)
83 && (y - getRootBoxOffsetY()) <= static_cast<int>(area.h)
93 bool WButton::mouseLBDOWN(int x, int y)
95 if ( (x - getRootBoxOffsetX()) >= 0
96 && (y - getRootBoxOffsetY()) >= 0
97 && (x - getRootBoxOffsetX()) <= static_cast<int>(area.w)
98 && (y - getRootBoxOffsetY()) <= static_cast<int>(area.h)