]> git.tdb.fi Git - r2c2.git/blob - source/engineer/controlpanel.h
Clear destination when setting a null route
[r2c2.git] / source / engineer / controlpanel.h
1 #ifndef CONTROLPANEL_H_
2 #define CONTROLPANEL_H_
3
4 #include <map>
5 #include <msp/gltk/panel.h>
6 #include <msp/gltk/toggle.h>
7 #include "libr2c2/blockiter.h"
8 #include "libr2c2/train.h"
9
10 class Engineer;
11 class PlacementGhost;
12
13 class ControlPanel: public Msp::GLtk::Panel
14 {
15 private:
16         Engineer &engineer;
17         R2C2::Train &train;
18         bool updating;
19         std::map<unsigned, Msp::GLtk::Toggle *> tgl_funcs;
20
21         bool placing;
22         std::vector<PlacementGhost *> ghosts;
23         R2C2::BlockIter place_location;
24
25 public:
26         ControlPanel(Engineer &, R2C2::Train &);
27
28 private:
29         void ui_function_toggled(bool, unsigned);
30         void train_function_changed(unsigned, bool);
31         void place_clicked();
32         void place_pick_done(R2C2::Track *, unsigned);
33         void take_clicked();
34         void view_clicked();
35
36         virtual void button_press(int, int, unsigned);
37         virtual void pointer_motion(int, int);
38 };
39
40 #endif