]> git.tdb.fi Git - r2c2.git/blobdiff - source/designer/trackproperties.cpp
Use some template magic to deduce the proper 3D type
[r2c2.git] / source / designer / trackproperties.cpp
index b85a99ae76e6459247f2f2719a0c17e287c0802d..c95ad02887f24d3bd99868aa7a6a6a83afe73253 100644 (file)
@@ -1,6 +1,7 @@
 #include <msp/gltk/button.h>
+#include <msp/gltk/column.h>
 #include <msp/gltk/label.h>
-#include <msp/gltk/mixedrows.h>
+#include <msp/gltk/row.h>
 #include "libr2c2/track.h"
 #include "libr2c2/tracktype.h"
 #include "selection.h"
@@ -13,35 +14,40 @@ using namespace R2C2;
 TrackProperties::TrackProperties(const Selection &s):
        selection(s)
 {
-       GLtk::MixedRows *rows = new GLtk::MixedRows;
-       set_layout(rows);
+       set_layout(new GLtk::Layout);
+       GLtk::Column col(*layout);
 
        GLtk::Label *lbl1, *lbl2;
 
        add(*(lbl1 = new GLtk::Label("Track properties")));
-       layout->set_expand(*lbl1, true, false);
        lbl1->set_style("title");
 
-       rows->start_row();
-       add(*(lbl1 = new GLtk::Label("Turnout ID")));
-       add(*(ent_turnout_id = new GLtk::Entry));
-       ent_turnout_id->set_edit_size(5, 1);
+       {
+               GLtk::Row row(*layout);
+               add(*(lbl1 = new GLtk::Label("Turnout ID")));
+               add(*(ent_turnout_id = new GLtk::Entry));
+               ent_turnout_id->set_edit_size(5, 1);
+       }
 
-       rows->start_row();
-       add(*(lbl2 = new GLtk::Label("Sensor ID")));
-       rows->add_constraint(*lbl1, GLtk::Layout::COPY_WIDTH, *lbl2);
-       add(*(ent_sensor_id = new GLtk::Entry));
-       ent_sensor_id->set_edit_size(5, 1);
+       {
+               GLtk::Row row(*layout);
+               add(*(lbl2 = new GLtk::Label("Sensor ID")));
+               layout->add_constraint(*lbl1, GLtk::Layout::COPY_WIDTH, *lbl2);
+               add(*(ent_sensor_id = new GLtk::Entry));
+               ent_sensor_id->set_edit_size(5, 1);
+       }
 
        GLtk::Button *btn;
 
-       rows->start_row();
-       rows->split_columns();
-       add_button(*(btn = new GLtk::Button("Cncl")), 0);
-       btn->set_style("red");
+       {
+               GLtk::Row row(*layout);
+               row.split();
+               add_button(*(btn = new GLtk::Button("Cncl")), 0);
+               btn->set_style("red");
 
-       add_button(*(btn = new GLtk::Button("OK")), 1);
-       btn->set_style("green");
+               add_button(*(btn = new GLtk::Button("OK")), 1);
+               btn->set_style("green");
+       }
 
        if(selection.size()==1)
        {