void Dialog::button_release(int x, int y, unsigned button)
{
Panel::button_release(x, y, button);
- if(stale)
- delete this;
+ check_stale();
}
bool Dialog::key_release(unsigned key, unsigned mod)
{
bool result = Panel::key_release(key, mod);
- if(stale)
- delete this;
+ check_stale();
+ return result;
+}
+
+bool Dialog::navigate(Navigation nav)
+{
+ bool result = Panel::navigate(nav);
+ check_stale();
return result;
}
stale = true;
}
+void Dialog::check_stale()
+{
+ if(stale)
+ delete this;
+}
+
Dialog::Loader::Loader(Dialog &d, WidgetMap &wm):
DerivedObjectLoader<Dialog, Panel::Loader>(d, wm)
virtual void button_release(int, int, unsigned);
virtual bool key_release(unsigned, unsigned);
+ virtual bool navigate(Navigation);
protected:
void response(int);
+ void check_stale();
/** Called when an action button is pressed. */
virtual void on_response(int) { }