Fixes
This commit is contained in:
+3
-1
@@ -37,7 +37,9 @@ void Button::onEvent(event_t event)
|
|||||||
TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString("Button").c_str(), event);
|
TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString("Button").c_str(), event);
|
||||||
|
|
||||||
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
|
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||||
onPress();
|
if (enabled) {
|
||||||
|
onPress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
FormField::onEvent(event);
|
FormField::onEvent(event);
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ class ModalWindow: public Window
|
|||||||
|
|
||||||
void deleteLater()
|
void deleteLater()
|
||||||
{
|
{
|
||||||
|
if (deleted)
|
||||||
|
return;
|
||||||
|
|
||||||
if (previousFocus) {
|
if (previousFocus) {
|
||||||
previousFocus->setFocus(SET_FOCUS_DEFAULT);
|
previousFocus->setFocus(SET_FOCUS_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ void Window::detach()
|
|||||||
|
|
||||||
void Window::deleteLater(bool detach)
|
void Window::deleteLater(bool detach)
|
||||||
{
|
{
|
||||||
|
if (deleted)
|
||||||
|
return;
|
||||||
|
|
||||||
TRACE_WINDOWS("Delete %p %s", this, getWindowDebugString().c_str());
|
TRACE_WINDOWS("Delete %p %s", this, getWindowDebugString().c_str());
|
||||||
|
|
||||||
if (static_cast<Window *>(focusWindow) == static_cast<Window *>(this)) {
|
if (static_cast<Window *>(focusWindow) == static_cast<Window *>(this)) {
|
||||||
@@ -85,6 +88,8 @@ void Window::deleteLater(bool detach)
|
|||||||
}
|
}
|
||||||
|
|
||||||
trash.push_back(this);
|
trash.push_back(this);
|
||||||
|
|
||||||
|
deleted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::clear()
|
void Window::clear()
|
||||||
|
|||||||
+1
@@ -354,6 +354,7 @@ class Window {
|
|||||||
coord_t scrollPositionY = 0;
|
coord_t scrollPositionY = 0;
|
||||||
WindowFlags windowFlags;
|
WindowFlags windowFlags;
|
||||||
LcdFlags textFlags;
|
LcdFlags textFlags;
|
||||||
|
bool deleted = false;
|
||||||
|
|
||||||
static Window * focusWindow;
|
static Window * focusWindow;
|
||||||
static Window * slidingWindow;
|
static Window * slidingWindow;
|
||||||
|
|||||||
Reference in New Issue
Block a user