This commit is contained in:
Bertrand Songis
2020-06-23 14:14:50 +02:00
parent a6a8543205
commit aaf835ab24
4 changed files with 12 additions and 1 deletions
+3 -1
View File
@@ -37,7 +37,9 @@ void Button::onEvent(event_t event)
TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString("Button").c_str(), event);
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
onPress();
if (enabled) {
onPress();
}
}
else {
FormField::onEvent(event);
+3
View File
@@ -36,6 +36,9 @@ class ModalWindow: public Window
void deleteLater()
{
if (deleted)
return;
if (previousFocus) {
previousFocus->setFocus(SET_FOCUS_DEFAULT);
}
+5
View File
@@ -69,6 +69,9 @@ void Window::detach()
void Window::deleteLater(bool detach)
{
if (deleted)
return;
TRACE_WINDOWS("Delete %p %s", this, getWindowDebugString().c_str());
if (static_cast<Window *>(focusWindow) == static_cast<Window *>(this)) {
@@ -85,6 +88,8 @@ void Window::deleteLater(bool detach)
}
trash.push_back(this);
deleted = true;
}
void Window::clear()
+1
View File
@@ -354,6 +354,7 @@ class Window {
coord_t scrollPositionY = 0;
WindowFlags windowFlags;
LcdFlags textFlags;
bool deleted = false;
static Window * focusWindow;
static Window * slidingWindow;