From: Mikko Rasa Date: Sat, 15 Jun 2013 21:34:53 +0000 (+0300) Subject: Support specifying layouts in datafiles X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=b30edd979e6e9c7acfaaf3a90903814a7e62a71e;p=libs%2Fgltk.git Support specifying layouts in datafiles --- diff --git a/source/column.cpp b/source/column.cpp index 6c225ee..d31544a 100644 --- a/source/column.cpp +++ b/source/column.cpp @@ -48,5 +48,17 @@ void Column::finish_slot() first = false; } + +Column::Loader::Loader(Column &c): + DataFile::ObjectLoader(c) +{ + add("split", &Loader::split); +} + +void Column::Loader::split() +{ + obj.split(); +} + } // namespace GLtk } // namespace Msp diff --git a/source/column.h b/source/column.h index c7efd3b..b6092bb 100644 --- a/source/column.h +++ b/source/column.h @@ -1,6 +1,7 @@ #ifndef MSP_GLTK_COLUMN_H_ #define MSP_GLTK_COLUMN_H_ +#include #include "arrangement.h" namespace Msp { @@ -8,6 +9,15 @@ namespace GLtk { class Column: public Arrangement { +public: + class Loader: public DataFile::ObjectLoader + { + public: + Loader(Column &); + private: + void split(); + }; + private: Edge next_bottom; bool first; diff --git a/source/dialog.cpp b/source/dialog.cpp index dba276d..2342e84 100644 --- a/source/dialog.cpp +++ b/source/dialog.cpp @@ -49,7 +49,7 @@ void Dialog::Loader::action_button(const string &n, int c) RefPtr