From: Mikko Rasa Date: Fri, 28 Jun 2013 20:20:49 +0000 (+0300) Subject: Some new datafile keywords X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ec63df81f6c3f77454b0fe3bdae24876c84616b1;p=libs%2Fgltk.git Some new datafile keywords --- diff --git a/source/entry.cpp b/source/entry.cpp index 9129e1b..12eff06 100644 --- a/source/entry.cpp +++ b/source/entry.cpp @@ -279,5 +279,18 @@ void Entry::slider_value_changed(double value) first_row = text.get_n_lines()-visible_rows-static_cast(value); } + +Entry::Loader::Loader(Entry &e): + DataFile::DerivedObjectLoader(e) +{ + add("edit_size", &Entry::edit_width, &Entry::edit_height); + add("multiline", &Loader::multiline); +} + +void Entry::Loader::multiline(bool m) +{ + obj.set_multiline(m); +} + } // namespace GLtk } // namespace Msp diff --git a/source/entry.h b/source/entry.h index 1594c68..4854340 100644 --- a/source/entry.h +++ b/source/entry.h @@ -22,6 +22,15 @@ Special parts: class Entry: virtual public Widget, private Container { public: + class Loader: public DataFile::DerivedObjectLoader + { + public: + Loader(Entry &); + + private: + void multiline(bool); + }; + sigc::signal signal_enter; private: diff --git a/source/list.cpp b/source/list.cpp index 296709c..2c13ccc 100644 --- a/source/list.cpp +++ b/source/list.cpp @@ -358,6 +358,7 @@ List::Loader::Loader(List &l): DataFile::DerivedObjectLoader(l) { add("item", &Loader::item); + add("view_size", &List::view_size); } void List::Loader::item(const string &v)