]> git.tdb.fi Git - r2c2.git/blob - source/designer/objectproperties.h
9180206bd2f8aa5989f3654b4b78d0a2ca746f41
[r2c2.git] / source / designer / objectproperties.h
1 #ifndef TRACKPROPERTIES_H_
2 #define TRACKPROPERTIES_H_
3
4 #include <msp/gltk/dialog.h>
5 #include <msp/gltk/entry.h>
6 #include "libr2c2/beamgate.h"
7 #include "libr2c2/signal.h"
8 #include "libr2c2/track.h"
9
10 class Selection;
11
12 class ObjectProperties: public Msp::GLtk::Dialog
13 {
14 private:
15         class Properties
16         {
17         protected:
18                 Properties() { }
19         public:
20                 virtual ~Properties() { }
21
22                 virtual void apply() = 0;
23         };
24
25         class TurnoutProperties: public Properties
26         {
27         private:
28                 R2C2::Track &track;
29                 Msp::GLtk::Entry *ent_address;
30
31         public:
32                 TurnoutProperties(ObjectProperties &, R2C2::Track &);
33
34                 virtual void apply();
35         };
36
37         class TrackCircuitProperties: public Properties
38         {
39         private:
40                 std::set<R2C2::Track *> tracks;
41                 Msp::GLtk::Entry *ent_address;
42
43         public:
44                 TrackCircuitProperties(ObjectProperties &, const std::set<R2C2::Track *> &);
45
46                 virtual void apply();
47         };
48
49         class SignalProperties: public Properties
50         {
51         private:
52                 R2C2::Signal &signal;
53                 Msp::GLtk::Entry *ent_address;
54
55         public:
56                 SignalProperties(ObjectProperties &, R2C2::Signal &);
57
58                 virtual void apply();
59         };
60
61         class BeamGateProperties: public Properties
62         {
63         private:
64                 R2C2::BeamGate &gate;
65                 Msp::GLtk::Entry *ent_address;
66
67         public:
68                 BeamGateProperties(ObjectProperties &, R2C2::BeamGate &);
69
70                 virtual void apply();
71         };
72
73         Properties *properties;
74         Msp::GLtk::Widget *prev_widget;
75
76 public:
77         ObjectProperties(const Selection &);
78
79 private:
80         Msp::GLtk::Entry *add_property(const std::string &, const std::string &, unsigned = 0);
81
82         virtual void on_response(int);
83 };
84
85 #endif