Buttons may be activated by a navigation event. There's now a protected
function that derived classes can call if they implement custom mechanisms
for producing a response.
void Dialog::button_release(int x, int y, unsigned button)
{
Panel::button_release(x, y, button);
void Dialog::button_release(int x, int y, unsigned button)
{
Panel::button_release(x, y, button);
- if(stale)
- delete this;
}
bool Dialog::key_release(unsigned key, unsigned mod)
{
bool result = Panel::key_release(key, mod);
}
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();
+void Dialog::check_stale()
+{
+ if(stale)
+ delete this;
+}
+
Dialog::Loader::Loader(Dialog &d, WidgetMap &wm):
DerivedObjectLoader<Dialog, Panel::Loader>(d, wm)
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 void button_release(int, int, unsigned);
virtual bool key_release(unsigned, unsigned);
+ virtual bool navigate(Navigation);
protected:
void response(int);
protected:
void response(int);
/** Called when an action button is pressed. */
virtual void on_response(int) { }
/** Called when an action button is pressed. */
virtual void on_response(int) { }