]> git.tdb.fi Git - libs/gltk.git/commitdiff
Some new datafile keywords
authorMikko Rasa <tdb@tdb.fi>
Fri, 28 Jun 2013 20:20:49 +0000 (23:20 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 28 Jun 2013 20:20:49 +0000 (23:20 +0300)
source/entry.cpp
source/entry.h
source/list.cpp

index 9129e1b0ebbdd90bef2b641629b271a9fe618f0b..12eff06ae4ffbc542e3b80726242b60ea03ee4ee 100644 (file)
@@ -279,5 +279,18 @@ void Entry::slider_value_changed(double value)
                first_row = text.get_n_lines()-visible_rows-static_cast<unsigned>(value);
 }
 
                first_row = text.get_n_lines()-visible_rows-static_cast<unsigned>(value);
 }
 
+
+Entry::Loader::Loader(Entry &e):
+       DataFile::DerivedObjectLoader<Entry, Widget::Loader>(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
 } // namespace GLtk
 } // namespace Msp
index 1594c68d8e7bb883eebdb04362a6b4db552fa26f..4854340a14f730a1fe90fcc9c847be1ce87514ce 100644 (file)
@@ -22,6 +22,15 @@ Special parts:
 class Entry: virtual public Widget, private Container
 {
 public:
 class Entry: virtual public Widget, private Container
 {
 public:
+       class Loader: public DataFile::DerivedObjectLoader<Entry, Widget::Loader>
+       {
+       public:
+               Loader(Entry &);
+
+       private:
+               void multiline(bool);
+       };
+
        sigc::signal<void> signal_enter;
 
 private:
        sigc::signal<void> signal_enter;
 
 private:
index 296709ce4f300b773a2035acade69ae053268725..2c13ccca8e2d403a8911c8061e0f502a60a60901 100644 (file)
@@ -358,6 +358,7 @@ List::Loader::Loader(List &l):
        DataFile::DerivedObjectLoader<List, Widget::Loader>(l)
 {
        add("item", &Loader::item);
        DataFile::DerivedObjectLoader<List, Widget::Loader>(l)
 {
        add("item", &Loader::item);
+       add("view_size", &List::view_size);
 }
 
 void List::Loader::item(const string &v)
 }
 
 void List::Loader::item(const string &v)