Protection

This commit is contained in:
Bertrand Songis
2020-03-05 11:25:45 +01:00
parent e66a95b60c
commit 4e47630eec
+6 -3
View File
@@ -154,16 +154,19 @@ void FormGroup::onEvent(event_t event)
TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString("FormGroup").c_str(), event);
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
first->setFocus(SET_FOCUS_FIRST);
if (first)
first->setFocus(SET_FOCUS_FIRST);
}
else if (event == EVT_KEY_BREAK(KEY_EXIT) && !hasFocus() && !(windowFlags & FORM_FORWARD_FOCUS)) {
setFocus(SET_FOCUS_DEFAULT);
}
else if (event == EVT_ROTARY_RIGHT && !next) {
first->setFocus(SET_FOCUS_FIRST);
if (first)
first->setFocus(SET_FOCUS_FIRST);
}
else if (event == EVT_ROTARY_LEFT && !previous) {
last->setFocus(SET_FOCUS_FIRST);
if (last)
last->setFocus(SET_FOCUS_FIRST);
}
else {
FormField::onEvent(event);