From b30edd979e6e9c7acfaaf3a90903814a7e62a71e Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 16 Jun 2013 00:34:53 +0300 Subject: [PATCH] Support specifying layouts in datafiles --- source/column.cpp | 12 ++++++++ source/column.h | 10 +++++++ source/dialog.cpp | 2 +- source/grid.cpp | 18 ++++++++++++ source/grid.h | 11 +++++++ source/layout.cpp | 37 +++++++++++++++++++++++ source/layout.h | 3 ++ source/panel.cpp | 75 ++++++++++++++++++++++++++++++++++++++++++++--- source/panel.h | 23 +++++++++++++-- source/row.cpp | 12 ++++++++ source/row.h | 10 +++++++ 11 files changed, 206 insertions(+), 7 deletions(-) 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