1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-06-28 12:39:50 +03:00
gmenu2x/src/helppopup.cpp
Maarten ter Huurne aff5f53f7d Don't pass around naked Surface pointers when drawing
Use references instead.
2014-08-10 04:26:59 +02:00

47 lines
1.1 KiB
C++

// Various authors.
// License: GPL version 2 or later.
#include "helppopup.h"
#include "gmenu2x.h"
HelpPopup::HelpPopup(GMenu2X& gmenu2x)
: gmenu2x(gmenu2x)
{
}
void HelpPopup::paint(Surface& s) {
Font& font = *gmenu2x.font;
Translator &tr = gmenu2x.tr;
int helpBoxHeight = 154;
s.box(10, 50, 300, helpBoxHeight + 4,
gmenu2x.skinConfColors[COLOR_MESSAGE_BOX_BG]);
s.rectangle(12, 52, 296, helpBoxHeight,
gmenu2x.skinConfColors[COLOR_MESSAGE_BOX_BORDER]);
font.write(s, tr["CONTROLS"], 20, 60);
#if defined(PLATFORM_A320) || defined(PLATFORM_GCW0)
font.write(s, tr["A: Launch link / Confirm action"], 20, 80);
font.write(s, tr["B: Show this help menu"], 20, 95);
font.write(s, tr["L, R: Change section"], 20, 110);
font.write(s, tr["SELECT: Show contextual menu"], 20, 155);
font.write(s, tr["START: Show options menu"], 20, 170);
#endif
}
bool HelpPopup::handleButtonPress(InputManager::Button button) {
if (button == InputManager::CANCEL) {
dismiss();
}
return true;
}
bool HelpPopup::handleTouchscreen(Touchscreen& ts) {
if (ts.pressed()) {
dismiss();
ts.setHandled();
}
return true;
}