Introduce POPUP_INFORMATION window
This commit is contained in:
@@ -266,6 +266,7 @@ uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint
|
|||||||
#define WARNING_TYPE_ASTERISK 0
|
#define WARNING_TYPE_ASTERISK 0
|
||||||
#define WARNING_TYPE_CONFIRM 1
|
#define WARNING_TYPE_CONFIRM 1
|
||||||
#define WARNING_TYPE_INPUT 2
|
#define WARNING_TYPE_INPUT 2
|
||||||
|
#define WARNING_TYPE_INFO 4
|
||||||
|
|
||||||
extern const char * warningText;
|
extern const char * warningText;
|
||||||
extern const char * warningInfoText;
|
extern const char * warningInfoText;
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ void runPopupWarning(event_t event)
|
|||||||
if (warningInfoText) {
|
if (warningInfoText) {
|
||||||
lcdDrawSizedText(WARNING_LINE_X, WARNING_LINE_Y+FH, warningInfoText, warningInfoLength, WARNING_INFO_FLAGS);
|
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) {
|
switch (event) {
|
||||||
case EVT_KEY_BREAK(KEY_ENTER):
|
case EVT_KEY_BREAK(KEY_ENTER):
|
||||||
if (warningType == WARNING_TYPE_ASTERISK)
|
if (warningType == WARNING_TYPE_ASTERISK)
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ extern uint8_t warningInfoFlags;
|
|||||||
#define SET_WARNING_INFO(...)
|
#define SET_WARNING_INFO(...)
|
||||||
#else
|
#else
|
||||||
#define DISPLAY_WARNING (*popupFunc)
|
#define DISPLAY_WARNING (*popupFunc)
|
||||||
|
#define POPUP_INFORMATION(s) (warningText = s, warningType = WARNING_TYPE_INFO, warningInfoText = 0, popupFunc = runPopupWarning)
|
||||||
#define POPUP_WARNING(s) (warningText = s, warningInfoText = 0, popupFunc = runPopupWarning)
|
#define POPUP_WARNING(s) (warningText = s, warningInfoText = 0, popupFunc = runPopupWarning)
|
||||||
#define POPUP_CONFIRMATION(s) (warningText = s, warningType = WARNING_TYPE_CONFIRM, warningInfoText = 0, popupFunc = runPopupWarning)
|
#define POPUP_CONFIRMATION(s) (warningText = s, warningType = WARNING_TYPE_CONFIRM, warningInfoText = 0, popupFunc = runPopupWarning)
|
||||||
#define POPUP_INPUT(s, func, start, min, max) (warningText = s, warningType = WARNING_TYPE_INPUT, popupFunc = func, warningInputValue = start, warningInputValueMin = min, warningInputValueMax = max)
|
#define POPUP_INPUT(s, func, start, min, max) (warningText = s, warningType = WARNING_TYPE_INPUT, popupFunc = func, warningInputValue = start, warningInputValueMin = min, warningInputValueMax = max)
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ void processRegisterFrame(uint8_t module, uint8_t * frame)
|
|||||||
if (memcmp(&frame[4], g_model.modelRegistrationID, PXX2_LEN_REGISTRATION_ID) == 0) {
|
if (memcmp(&frame[4], g_model.modelRegistrationID, PXX2_LEN_REGISTRATION_ID) == 0) {
|
||||||
reusableBuffer.modelsetup.pxx2_register_or_bind_step = REGISTER_OK;
|
reusableBuffer.modelsetup.pxx2_register_or_bind_step = REGISTER_OK;
|
||||||
moduleSettings[module].mode = MODULE_MODE_NORMAL;
|
moduleSettings[module].mode = MODULE_MODE_NORMAL;
|
||||||
POPUP_WARNING(STR_REG_OK);
|
POPUP_INFORMATION(STR_REG_OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,7 +125,7 @@ void processBindFrame(uint8_t module, uint8_t * frame)
|
|||||||
if (memcmp(reusableBuffer.modelsetup.pxx2_bind_candidate_receivers_ids[reusableBuffer.modelsetup.pxx2_bind_selected_receiver_index], &frame[4], PXX2_LEN_RX_ID) == 0) {
|
if (memcmp(reusableBuffer.modelsetup.pxx2_bind_candidate_receivers_ids[reusableBuffer.modelsetup.pxx2_bind_selected_receiver_index], &frame[4], PXX2_LEN_RX_ID) == 0) {
|
||||||
reusableBuffer.modelsetup.pxx2_register_or_bind_step = BIND_OK;
|
reusableBuffer.modelsetup.pxx2_register_or_bind_step = BIND_OK;
|
||||||
moduleSettings[module].mode = MODULE_MODE_NORMAL;
|
moduleSettings[module].mode = MODULE_MODE_NORMAL;
|
||||||
POPUP_WARNING(STR_BIND_OK);
|
POPUP_INFORMATION(STR_BIND_OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ const char STR_OPEN9X[] =
|
|||||||
|
|
||||||
// The 0-terminated-strings
|
// The 0-terminated-strings
|
||||||
const char STR_POPUPS[] = TR_POPUPS;
|
const char STR_POPUPS[] = TR_POPUPS;
|
||||||
|
const char STR_OK[] = TR_OK;
|
||||||
#if !defined(OFS_EXIT)
|
#if !defined(OFS_EXIT)
|
||||||
const char STR_EXIT[] = TR_EXIT;
|
const char STR_EXIT[] = TR_EXIT;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -329,6 +329,7 @@ extern const char STR_BLUETOOTH_LOCAL_ADDR[];
|
|||||||
#define NO_INDENT(x) (x)+LEN_INDENT
|
#define NO_INDENT(x) (x)+LEN_INDENT
|
||||||
|
|
||||||
extern const char STR_POPUPS[];
|
extern const char STR_POPUPS[];
|
||||||
|
extern const char STR_OK[];
|
||||||
|
|
||||||
#if defined(OFS_EXIT)
|
#if defined(OFS_EXIT)
|
||||||
#define STR_EXIT (STR_POPUPS + OFS_EXIT)
|
#define STR_EXIT (STR_POPUPS + OFS_EXIT)
|
||||||
|
|||||||
@@ -534,6 +534,7 @@
|
|||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define TR_POPUPS TR(TR_EXIT "\010" TR_ENTER, TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER)
|
#define TR_POPUPS TR(TR_EXIT "\010" TR_ENTER, TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER)
|
||||||
|
define TR_OK TR("\010" "\010" "\010" "[OK]", "\010" "\010" "\010" "\010" "\010" "[OK]")
|
||||||
#else
|
#else
|
||||||
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
||||||
#define OFS_EXIT sizeof(TR_ENTER)
|
#define OFS_EXIT sizeof(TR_ENTER)
|
||||||
|
|||||||
@@ -540,6 +540,7 @@
|
|||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
||||||
|
define TR_OK TR("\010" "\010" "\010" "[OK]", "\010" "\010" "\010" "\010" "\010" "[OK]")
|
||||||
#else
|
#else
|
||||||
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
||||||
#define OFS_EXIT sizeof(TR_ENTER)
|
#define OFS_EXIT sizeof(TR_ENTER)
|
||||||
|
|||||||
@@ -538,6 +538,7 @@
|
|||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define TR_POPUPS TR(TR_EXIT "\010" TR_ENTER, TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER)
|
#define TR_POPUPS TR(TR_EXIT "\010" TR_ENTER, TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER)
|
||||||
|
#define TR_OK TR("\010" "\010" "\010" "[OK]", "\010" "\010" "\010" "\010" "\010" "[OK]")
|
||||||
#else
|
#else
|
||||||
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
||||||
#define OFS_EXIT sizeof(TR_ENTER)
|
#define OFS_EXIT sizeof(TR_ENTER)
|
||||||
|
|||||||
@@ -538,6 +538,7 @@
|
|||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
||||||
|
define TR_OK TR("\010" "\010" "\010" "[OK]", "\010" "\010" "\010" "\010" "\010" "[OK]")
|
||||||
#else
|
#else
|
||||||
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
||||||
#define OFS_EXIT sizeof(TR_ENTER)
|
#define OFS_EXIT sizeof(TR_ENTER)
|
||||||
|
|||||||
@@ -530,6 +530,7 @@
|
|||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
||||||
|
define TR_OK TR("\010" "\010" "\010" "[OK]", "\010" "\010" "\010" "\010" "\010" "[OK]")
|
||||||
#else
|
#else
|
||||||
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
||||||
#define OFS_EXIT sizeof(TR_ENTER)
|
#define OFS_EXIT sizeof(TR_ENTER)
|
||||||
|
|||||||
@@ -551,6 +551,7 @@
|
|||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define TR_POPUPS TR(TR_EXIT "\010" TR_ENTER, TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER)
|
#define TR_POPUPS TR(TR_EXIT "\010" TR_ENTER, TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER)
|
||||||
|
define TR_OK TR("\010" "\010" "\010" "[OK]", "\010" "\010" "\010" "\010" "\010" "[OK]")
|
||||||
#else
|
#else
|
||||||
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
||||||
#define OFS_EXIT sizeof(TR_ENTER)
|
#define OFS_EXIT sizeof(TR_ENTER)
|
||||||
|
|||||||
@@ -540,6 +540,7 @@
|
|||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
||||||
|
define TR_OK TR("\010" "\010" "\010" "[OK]", "\010" "\010" "\010" "\010" "\010" "[OK]")
|
||||||
#else
|
#else
|
||||||
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
||||||
#define OFS_EXIT sizeof(TR_ENTER)
|
#define OFS_EXIT sizeof(TR_ENTER)
|
||||||
|
|||||||
@@ -535,6 +535,7 @@
|
|||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
||||||
|
define TR_OK TR("\010" "\010" "\010" "[OK]", "\010" "\010" "\010" "\010" "\010" "[OK]")
|
||||||
#else
|
#else
|
||||||
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
||||||
#define OFS_EXIT sizeof(TR_ENTER)
|
#define OFS_EXIT sizeof(TR_ENTER)
|
||||||
|
|||||||
@@ -541,6 +541,7 @@
|
|||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
||||||
|
define TR_OK TR("\010" "\010" "\010" "[OK]", "\010" "\010" "\010" "\010" "\010" "[OK]")
|
||||||
#else
|
#else
|
||||||
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
||||||
#define OFS_EXIT sizeof(TR_ENTER)
|
#define OFS_EXIT sizeof(TR_ENTER)
|
||||||
|
|||||||
@@ -537,6 +537,7 @@
|
|||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
||||||
|
define TR_OK TR("\010" "\010" "\010" "[OK]", "\010" "\010" "\010" "\010" "\010" "[OK]")
|
||||||
#else
|
#else
|
||||||
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
||||||
#define OFS_EXIT sizeof(TR_ENTER)
|
#define OFS_EXIT sizeof(TR_ENTER)
|
||||||
|
|||||||
@@ -549,6 +549,7 @@
|
|||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
#define TR_POPUPS TR_EXIT "\010" "\010" "\010" "\010" TR_ENTER
|
||||||
|
define TR_OK TR("\010" "\010" "\010" "[OK]", "\010" "\010" "\010" "\010" "\010" "[OK]")
|
||||||
#else
|
#else
|
||||||
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
#define TR_POPUPS TR_ENTER "\010" TR_EXIT
|
||||||
#define OFS_EXIT sizeof(TR_ENTER)
|
#define OFS_EXIT sizeof(TR_ENTER)
|
||||||
|
|||||||
Reference in New Issue
Block a user