X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdialog.cpp;h=7b47b66e9571c80800ae9bcd152fd0e1ea06b250;hb=6d73e04329fc3752552773e4d11d7374caf779f6;hp=5eea60964ec3d694ff94b001cc8a7702473824d8;hpb=531232cf05838b79c1f8f36c8103730e32dfa23d;p=libs%2Fgltk.git diff --git a/source/dialog.cpp b/source/dialog.cpp index 5eea609..7b47b66 100644 --- a/source/dialog.cpp +++ b/source/dialog.cpp @@ -1,19 +1,12 @@ -/* $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 { -Dialog::Dialog(const Resources &r): - Widget(r), - Panel(r), +Dialog::Dialog(): stale(false) { } @@ -30,18 +23,34 @@ 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) { on_response(code); signal_response.emit(code); - stale=true; + 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