X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdialog.cpp;h=a264fbe87ce753de12b4b7c89ba76d5a849f2fa9;hb=bea19bdc0d51a2ebacb007b9503e851258fd148f;hp=dba276d32d7aa05de119fa2cdf48407cbdcf4fe9;hpb=8c24649c40829dd1ce78ca4bbcae0913574ab292;p=libs%2Fgltk.git diff --git a/source/dialog.cpp b/source/dialog.cpp index dba276d..a264fbe 100644 --- a/source/dialog.cpp +++ b/source/dialog.cpp @@ -16,18 +16,36 @@ void Dialog::add_button(Button &button, int code) button.signal_clicked.connect(sigc::bind(sigc::mem_fun(this, &Dialog::response), code)); } +void Dialog::set_modal(bool m) +{ + if(m) + { + set_focus(); + if(state&FOCUS) + signal_grab_pointer.emit(); + } + else + signal_ungrab_pointer.emit(); +} + void Dialog::button_release(int x, int y, unsigned button) { Panel::button_release(x, y, button); - if(stale) - delete this; + check_stale(); } -void Dialog::key_release(unsigned key, unsigned mod) +bool Dialog::key_release(unsigned key, unsigned mod) { - Panel::key_release(key, mod); - if(stale) - delete this; + 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) @@ -37,6 +55,12 @@ void Dialog::response(int code) stale = true; } +void Dialog::check_stale() +{ + if(stale) + delete this; +} + Dialog::Loader::Loader(Dialog &d, WidgetMap &wm): DerivedObjectLoader(d, wm) @@ -49,7 +73,7 @@ void Dialog::Loader::action_button(const string &n, int c) RefPtr