X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flogic.cpp;h=e9542a6dfb26815f7d4e371911ae65775e991b8b;hb=79af58bcfa941e0f2c33b172c9e924522ebcdfea;hp=3ed745c09c9e083233efada18fb76d6d94c707e3;hpb=2b70e8801c43875ed3f4135bdd0141265cff0312;p=libs%2Fgltk.git diff --git a/source/logic.cpp b/source/logic.cpp index 3ed745c..e9542a6 100644 --- a/source/logic.cpp +++ b/source/logic.cpp @@ -1,3 +1,4 @@ +#include #include "logic.h" using namespace std; @@ -6,7 +7,7 @@ namespace Msp { namespace GLtk { Logic::Loader::Loader(Logic &l, const map &w): - logic(l), + DataFile::ObjectLoader(l), widgets(w) { add("bind", &Loader::bind); @@ -14,17 +15,14 @@ Logic::Loader::Loader(Logic &l, const map &w): void Logic::Loader::bind(const string &wdg, const string &data) { - map::const_iterator i = widgets.find(wdg); - if(i==widgets.end()) - throw KeyError("Unknown widget", wdg); + WidgetBinding act; + act.wdg = get_item(widgets, wdg); string::size_type colon = data.find(':'); - WidgetBinding act; - act.wdg = i->second; act.type = data.substr(0, colon); if(colon!=string::npos) act.data = data.substr(colon+1); - logic.bindings.push_back(act); + obj.bindings.push_back(act); } } // namespace GLtk