]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/row.cpp
Add some sanity checks to arrangements
[libs/gltk.git] / source / row.cpp
index fc07cdbf25cb1c92cd56ca7e236edf9cb99c922f..92f3fe62b19e77c8bdf9792f033420be58f88347 100644 (file)
@@ -12,6 +12,9 @@ Row::Row(Layout &l):
 
 void Row::split()
 {
+       if(gravity>0)
+               throw arrangement_error("already split");
+
        split_here = true;
        gravity = 1;
 }
@@ -48,5 +51,17 @@ void Row::finish_slot()
        first = false;
 }
 
+
+Row::Loader::Loader(Row &c):
+       DataFile::ObjectLoader<Row>(c)
+{
+       add("split", &Loader::split);
+}
+
+void Row::Loader::split()
+{
+       obj.split();
+}
+
 } // namespace GLtk
 } // namespace Msp