]> git.tdb.fi Git - r2c2.git/commitdiff
More code for TrainProperties
authorMikko Rasa <tdb@tdb.fi>
Wed, 18 Jul 2007 09:28:11 +0000 (09:28 +0000)
committerMikko Rasa <tdb@tdb.fi>
Wed, 18 Jul 2007 09:28:11 +0000 (09:28 +0000)
source/engineer/trainproperties.cpp
source/engineer/trainproperties.h

index adb48d3385edc039d8c319bfb3b7e94518911133..1aebea029eb2506e070e87c650f5d0f345422f27 100644 (file)
@@ -1,21 +1,26 @@
+#include <msp/gltk/button.h>
 #include "trainproperties.h"
 
 using namespace Msp;
+using namespace Marklin;
 
 TrainProperties::TrainProperties(GLtk::Resources &r, Train &t):
        Panel(r),
        train(t)
 {
-       set_size(200, 50);
+       set_size(200, 75);
 
        add(*(ent_name=new GLtk::Entry(res, train.get_name())));
-       ent_name->set_geometry(
+       ent_name->set_geometry(GLtk::Geometry(5, geom.h-25, geom.w-10, 20));
+
+       add(*(ent_name=new GLtk::Entry(res, train.get_name())));
+       ent_name->set_geometry(GLtk::Geometry(5, geom.h-50, geom.w-10, 20));
 
        GLtk::Button *btn;
 
        add(*(btn=new GLtk::Button(res, "OK")));
-       btn->set_geometry(geom.width-45, 5, 40, 25);
+       btn->set_geometry(GLtk::Geometry(geom.w-45, 5, 40, 25));
 
        add(*(btn=new GLtk::Button(res, "Cncl")));
-       btn->set_geometry(geom.width-45, 5, 40, 25);
+       btn->set_geometry(GLtk::Geometry(geom.w-90, 5, 40, 25));
 }
index de0d8a8ff592ebf227f1c3f6f002c5e096d88edd..89b6e94eb7311d427ec22fb60300435eba845828 100644 (file)
@@ -1,14 +1,16 @@
 #ifndef TRAINPROPERTIES_H_
 #define TRAINPROPERTIES_H_
 
+#include <msp/gltk/entry.h>
 #include <msp/gltk/panel.h>
+#include <libmarklin/train.h>
 
 class TrainProperties: public Msp::GLtk::Panel
 {
 public:
-       TrainProperties(Msp::GLtk::Resources &, Train &);
+       TrainProperties(Msp::GLtk::Resources &, Marklin::Train &);
 private:
-       Train &train;
+       Marklin::Train &train;
        Msp::GLtk::Entry *ent_id;
        Msp::GLtk::Entry *ent_name;
 };