]> git.tdb.fi Git - r2c2.git/commitdiff
Add train properties dialog (unfinished)
authorMikko Rasa <tdb@tdb.fi>
Tue, 17 Jul 2007 08:33:11 +0000 (08:33 +0000)
committerMikko Rasa <tdb@tdb.fi>
Tue, 17 Jul 2007 08:33:11 +0000 (08:33 +0000)
Remove some unnecessary files

source/engineer/guicomponent.h [deleted file]
source/engineer/guiresources.h [deleted file]
source/engineer/trainproperties.cpp [new file with mode: 0644]
source/engineer/trainproperties.h [new file with mode: 0644]

diff --git a/source/engineer/guicomponent.h b/source/engineer/guicomponent.h
deleted file mode 100644 (file)
index f752936..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef GUICOMPONENT_H_
-#define GUICOMPONENT_H_
-
-class GuiComponent
-{
-public:
-       enum HAlign
-       {
-               LEFT,
-               CENTER,
-               RIGHT
-       };
-
-       enum VAlign
-       {
-               TOP,
-               MIDDLE,
-               BOTTOM
-       };
-
-       struct Part
-       {
-               enum Type
-               {
-                       IMAGE,
-                       LABEL,
-                       TEXT
-               };
-
-               std::string variation;
-               std::string state;
-               Type type;
-               std::string data;
-               HAlign align_x;
-               VAlign align_y;
-               int offset_x;
-               int offset_y;
-       };
-       typedef std::list<Part> PartSeq;
-
-private:
-};
-
-#endif
diff --git a/source/engineer/guiresources.h b/source/engineer/guiresources.h
deleted file mode 100644 (file)
index 86d29ce..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef GUIRESOURCES_H_
-#define GUIRESOURCES_H_
-
-#endif
diff --git a/source/engineer/trainproperties.cpp b/source/engineer/trainproperties.cpp
new file mode 100644 (file)
index 0000000..adb48d3
--- /dev/null
@@ -0,0 +1,21 @@
+#include "trainproperties.h"
+
+using namespace Msp;
+
+TrainProperties::TrainProperties(GLtk::Resources &r, Train &t):
+       Panel(r),
+       train(t)
+{
+       set_size(200, 50);
+
+       add(*(ent_name=new GLtk::Entry(res, train.get_name())));
+       ent_name->set_geometry(
+
+       GLtk::Button *btn;
+
+       add(*(btn=new GLtk::Button(res, "OK")));
+       btn->set_geometry(geom.width-45, 5, 40, 25);
+
+       add(*(btn=new GLtk::Button(res, "Cncl")));
+       btn->set_geometry(geom.width-45, 5, 40, 25);
+}
diff --git a/source/engineer/trainproperties.h b/source/engineer/trainproperties.h
new file mode 100644 (file)
index 0000000..de0d8a8
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef TRAINPROPERTIES_H_
+#define TRAINPROPERTIES_H_
+
+#include <msp/gltk/panel.h>
+
+class TrainProperties: public Msp::GLtk::Panel
+{
+public:
+       TrainProperties(Msp::GLtk::Resources &, Train &);
+private:
+       Train &train;
+       Msp::GLtk::Entry *ent_id;
+       Msp::GLtk::Entry *ent_name;
+};
+
+#endif