X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdialog.cpp;h=7b47b66e9571c80800ae9bcd152fd0e1ea06b250;hb=db2a069cd5ec4c8809c2ba6ddeec2ddcd32d49ef;hp=5a03102f463dd8b551e5606253c2b0426aa683a4;hpb=91997dd3189b93a67179822ec2fed5f2a7bddb74;p=libs%2Fgltk.git diff --git a/source/dialog.cpp b/source/dialog.cpp index 5a03102..7b47b66 100644 --- a/source/dialog.cpp +++ b/source/dialog.cpp @@ -1,13 +1,8 @@ -/* $Id$ - -This file is part of libmspgltk -Copyright © 2010 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include "button.h" #include "dialog.h" +using namespace std; + namespace Msp { namespace GLtk { @@ -28,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) @@ -42,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