[Window] deleteLater made virtual

This commit is contained in:
Bertrand Songis
2020-11-04 16:48:53 +01:00
parent 8aeae1d72f
commit 25a3a20642
2 changed files with 10 additions and 7 deletions
+5 -4
View File
@@ -33,7 +33,7 @@ class ModalWindow: public Window
}
#endif
void deleteLater()
void deleteLater(bool detach=true) override
{
if (_deleted)
return;
@@ -42,7 +42,7 @@ class ModalWindow: public Window
previousFocus->setFocus(SET_FOCUS_DEFAULT);
}
Window::deleteLater();
Window::deleteLater(detach);
}
void paint(BitmapBuffer * dc) override;
@@ -87,11 +87,12 @@ class ModalWindow: public Window
}
protected:
Window * previousFocus = nullptr;
Window * previousFocus;
bool closeAllowed = true;
};
class ModalWindowContent: public Window {
class ModalWindowContent: public Window
{
public:
explicit ModalWindowContent(ModalWindow * parent, const rect_t & rect):
Window(parent, rect, OPAQUE)
+5 -3
View File
@@ -50,14 +50,16 @@ constexpr WindowFlags PAINT_CHILDREN_FIRST = 1u << 6u;
constexpr WindowFlags PUSH_FRONT = 1u << 7u;
constexpr WindowFlags WINDOW_FLAGS_LAST = PUSH_FRONT;
enum SetFocusFlag {
enum SetFocusFlag
{
SET_FOCUS_DEFAULT,
SET_FOCUS_FORWARD,
SET_FOCUS_BACKWARD,
SET_FOCUS_FIRST
};
class Window {
class Window
{
friend class GridLayout;
public:
@@ -135,7 +137,7 @@ class Window {
focusHandler = std::move(handler);
}
void deleteLater(bool detach=true);
virtual void deleteLater(bool detach=true);
void clear();