X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdialog.cpp;h=7b47b66e9571c80800ae9bcd152fd0e1ea06b250;hb=2b3940dd34611a6f669278de9a5146b6e85f6119;hp=cc4c1bf6a51f67cd1b00ecd46a9fc3cb2fda0c90;hpb=2b70e8801c43875ed3f4135bdd0141265cff0312;p=libs%2Fgltk.git diff --git a/source/dialog.cpp b/source/dialog.cpp index cc4c1bf..7b47b66 100644 --- a/source/dialog.cpp +++ b/source/dialog.cpp @@ -1,6 +1,8 @@ #include "button.h" #include "dialog.h" +using namespace std; + namespace Msp { namespace GLtk { @@ -21,11 +23,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) @@ -35,5 +38,20 @@ void Dialog::response(int code) stale = true; } + +Dialog::Loader::Loader(Dialog &d, WidgetMap &wm): + DerivedObjectLoader(d, wm) +{ + add("action_button", &Loader::action_button); +} + +void Dialog::Loader::action_button(const string &n, int c) +{ + RefPtr