1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-06-30 21:17:18 +03:00
gmenu2x/src/helppopup.cpp

47 lines
1.1 KiB
C++
Raw Normal View History

// 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) {
2013-08-11 01:05:18 +03:00
dismiss();
}
return true;
}
bool HelpPopup::handleTouchscreen(Touchscreen& ts) {
if (ts.pressed()) {
2013-08-11 01:05:18 +03:00
dismiss();
ts.setHandled();
}
return true;
}