Introduce POPUP_INFORMATION window

This commit is contained in:
3djc
2019-02-07 10:17:19 +01:00
parent c5e8f18611
commit d01f1e8b3e
17 changed files with 23 additions and 8 deletions
+6 -6
View File
@@ -2,7 +2,7 @@
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
@@ -65,7 +65,7 @@ void drawAlertBox(const char * title, const char * text, const char * action)
lcdDrawText(MESSAGE_LCD_OFFSET, 0, title, DBLSIZE);
lcdDrawText(MESSAGE_LCD_OFFSET, 2*FH, STR_WARNING, DBLSIZE);
#endif
lcdDrawSolidFilledRect(0, 0, LCD_W, 32);
if (text) {
lcdDrawTextAlignedLeft(5*FH, text);
@@ -73,16 +73,16 @@ void drawAlertBox(const char * title, const char * text, const char * action)
if (action) {
lcdDrawTextAlignedLeft(7*FH, action);
}
#undef MESSAGE_LCD_OFFSET
}
void showAlertBox(const char * title, const char * text, const char * action , uint8_t sound)
{
drawAlertBox(title, text, action);
AUDIO_ERROR_MESSAGE(sound);
lcdRefresh();
lcdSetContrast();
clearKeyEvents();
@@ -97,7 +97,7 @@ void runPopupWarning(event_t event)
if (warningInfoText) {
lcdDrawSizedText(WARNING_LINE_X, WARNING_LINE_Y+FH, warningInfoText, warningInfoLength, WARNING_INFO_FLAGS);
}
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y+2*FH, warningType == WARNING_TYPE_ASTERISK ? STR_EXIT : STR_POPUPS);
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y+2*FH, warningType == WARNING_TYPE_INFO ? STR_OK : (warningType == WARNING_TYPE_ASTERISK ? STR_EXIT : STR_POPUPS));
switch (event) {
case EVT_KEY_BREAK(KEY_ENTER):
if (warningType == WARNING_TYPE_ASTERISK)