X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdialog.cpp;h=0b22e9874a8d1578266fe6b98a95ddca84cf3cc5;hb=32d668c967c881ed386be22f17e3477a4405436b;hp=dba276d32d7aa05de119fa2cdf48407cbdcf4fe9;hpb=8c24649c40829dd1ce78ca4bbcae0913574ab292;p=libs%2Fgltk.git diff --git a/source/dialog.cpp b/source/dialog.cpp index dba276d..0b22e98 100644 --- a/source/dialog.cpp +++ b/source/dialog.cpp @@ -16,6 +16,18 @@ 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); @@ -23,11 +35,12 @@ void Dialog::button_release(int x, int y, unsigned button) delete this; } -void Dialog::key_release(unsigned key, unsigned mod) +bool Dialog::key_release(unsigned key, unsigned mod) { - Panel::key_release(key, mod); + bool result = Panel::key_release(key, mod); if(stale) delete this; + return result; } void Dialog::response(int code) @@ -49,7 +62,7 @@ void Dialog::Loader::action_button(const string &n, int c) RefPtr