]> git.tdb.fi Git - r2c2.git/blobdiff - source/engineer/mainpanel.cpp
Simulate commands if no serial device is set to make turnouts work
[r2c2.git] / source / engineer / mainpanel.cpp
index 0178eb41e1c754c6ea9bcac2f913f588ccfe3e29..8c3718b9176fa025bcda7087633cf8357a10522e 100644 (file)
@@ -1,11 +1,20 @@
+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
 #include <msp/gltk/button.h>
 #include "engineer.h"
 #include "mainpanel.h"
+#include "trainproperties.h"
 
 using namespace std;
 using namespace Msp;
 
 MainPanel::MainPanel(Engineer &e, GLtk::Resources &r):
+       Widget(r),
        Panel(r),
        engineer(e)
 {
@@ -73,7 +82,10 @@ void MainPanel::power_off()
 
 void MainPanel::new_loc()
 {
-       engineer.add_train();
+       TrainProperties *dialog = new TrainProperties(engineer, res, 0);
+       engineer.get_root().add(*dialog);
+       dialog->set_position(geom.x+geom.w, geom.y+geom.h-dialog->get_geometry().h);
+       dialog->set_visible(true);
 }
 
 void MainPanel::quit()