X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdialog.cpp;h=5e5e390e7cadadf91d3e5af4e978d4e3f333dc33;hb=b4d0a86b77fb5146f5a4f6c76690c16204210f1a;hp=a264fbe87ce753de12b4b7c89ba76d5a849f2fa9;hpb=bea19bdc0d51a2ebacb007b9503e851258fd148f;p=libs%2Fgltk.git diff --git a/source/dialog.cpp b/source/dialog.cpp index a264fbe..5e5e390 100644 --- a/source/dialog.cpp +++ b/source/dialog.cpp @@ -6,10 +6,6 @@ using namespace std; namespace Msp { namespace GLtk { -Dialog::Dialog(): - stale(false) -{ } - void Dialog::add_button(Button &button, int code) { add(button); @@ -28,37 +24,11 @@ void Dialog::set_modal(bool m) signal_ungrab_pointer.emit(); } -void Dialog::button_release(int x, int y, unsigned button) -{ - Panel::button_release(x, y, button); - check_stale(); -} - -bool Dialog::key_release(unsigned key, unsigned mod) -{ - bool result = Panel::key_release(key, mod); - check_stale(); - return result; -} - -bool Dialog::navigate(Navigation nav) -{ - bool result = Panel::navigate(nav); - check_stale(); - return result; -} - void Dialog::response(int code) { on_response(code); signal_response.emit(code); - stale = true; -} - -void Dialog::check_stale() -{ - if(stale) - delete this; + set_visible(false); } @@ -70,7 +40,7 @@ Dialog::Loader::Loader(Dialog &d, WidgetMap &wm): void Dialog::Loader::action_button(const string &n, int c) { - RefPtr