From 8235a1d97d11599d155f77aa454b28db46cfaf58 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 7 Jul 2020 12:57:32 +0200 Subject: [PATCH] Add a waitHandler to Menu --- radio/src/thirdparty/libopenui/src/menu.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/radio/src/thirdparty/libopenui/src/menu.h b/radio/src/thirdparty/libopenui/src/menu.h index 3cf211f3f..aac85d94f 100644 --- a/radio/src/thirdparty/libopenui/src/menu.h +++ b/radio/src/thirdparty/libopenui/src/menu.h @@ -160,6 +160,11 @@ class Menu: public ModalWindow { content->body.setCancelHandler(handler); } + void setWaitHandler(std::function handler) + { + waitHandler = std::move(handler); + } + void setToolbar(Window * window) { toolbar = window; @@ -190,9 +195,18 @@ class Menu: public ModalWindow { void onEvent(event_t event) override; #endif + void checkEvents() override + { + ModalWindow::checkEvents(); + if (waitHandler) { + waitHandler(); + } + } + protected: MenuWindowContent * content; Window * toolbar = nullptr; + std::function waitHandler; void updatePosition(); };