Add a waitHandler to Menu
This commit is contained in:
+14
@@ -160,6 +160,11 @@ class Menu: public ModalWindow {
|
|||||||
content->body.setCancelHandler(handler);
|
content->body.setCancelHandler(handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setWaitHandler(std::function<void()> handler)
|
||||||
|
{
|
||||||
|
waitHandler = std::move(handler);
|
||||||
|
}
|
||||||
|
|
||||||
void setToolbar(Window * window)
|
void setToolbar(Window * window)
|
||||||
{
|
{
|
||||||
toolbar = window;
|
toolbar = window;
|
||||||
@@ -190,9 +195,18 @@ class Menu: public ModalWindow {
|
|||||||
void onEvent(event_t event) override;
|
void onEvent(event_t event) override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void checkEvents() override
|
||||||
|
{
|
||||||
|
ModalWindow::checkEvents();
|
||||||
|
if (waitHandler) {
|
||||||
|
waitHandler();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
MenuWindowContent * content;
|
MenuWindowContent * content;
|
||||||
Window * toolbar = nullptr;
|
Window * toolbar = nullptr;
|
||||||
|
std::function<void()> waitHandler;
|
||||||
void updatePosition();
|
void updatePosition();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user