dialog: handle EXIT key
This commit is contained in:
committed by
Raphael Coeffic
parent
f8612a0dbe
commit
e97cff4dcb
+10
@@ -57,3 +57,13 @@ Dialog::Dialog(Window* parent, std::string title, const rect_t& rect) :
|
|||||||
bringToTop();
|
bringToTop();
|
||||||
if (!title.empty()) content->setTitle(std::move(title));
|
if (!title.empty()) content->setTitle(std::move(title));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Dialog::onEvent(event_t event)
|
||||||
|
{
|
||||||
|
#if defined(HARDWARE_KEYS)
|
||||||
|
if (event == EVT_KEY_LONG(KEY_EXIT) || event == EVT_KEY_BREAK(KEY_EXIT)) {
|
||||||
|
killEvents(event);
|
||||||
|
deleteLater();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|||||||
+1
@@ -48,5 +48,6 @@ class Dialog : public ModalWindow
|
|||||||
Dialog(Window* parent, std::string title, const rect_t& rect);
|
Dialog(Window* parent, std::string title, const rect_t& rect);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void onEvent(event_t event) override;
|
||||||
DialogWindowContent* content;
|
DialogWindowContent* content;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user