]> git.tdb.fi Git - r2c2.git/blob - source/engineer/trainpanel.h
Further adjustments to changes in GLtk
[r2c2.git] / source / engineer / trainpanel.h
1 #ifndef TRAINPANEL_H_
2 #define TRAINPANEL_H_
3
4 #include <sigc++/trackable.h>
5 #include <msp/gltk/button.h>
6 #include <msp/gltk/hslider.h>
7 #include <msp/gltk/label.h>
8 #include <msp/gltk/panel.h>
9 #include <msp/gltk/toggle.h>
10 #include "libr2c2/route.h"
11 #include "libr2c2/train.h"
12 #include "libr2c2/trainstatus.h"
13
14 class Engineer;
15
16 class TrainPanel: public Msp::GLtk::Panel, public sigc::trackable
17 {
18 private:
19         Engineer &engineer;
20         R2C2::Train &train;
21         R2C2::TrainStatus status;
22         Msp::GLtk::Panel *pnl_basic;
23         Msp::GLtk::Panel *pnl_extra;
24         Msp::GLtk::Button *btn_expand;
25         Msp::GLtk::Label *lbl_addr;
26         Msp::GLtk::Label *lbl_name;
27         Msp::GLtk::HSlider *sld_speed;
28         Msp::GLtk::Label *lbl_speed;
29         Msp::GLtk::Label *lbl_route;
30         Msp::GLtk::Label *lbl_status;
31         Msp::GLtk::Toggle *tgl_forward;
32         std::map<unsigned, Msp::GLtk::Toggle *> tgl_funcs;
33         sigc::connection pick_conn;
34         bool expanded;
35
36 public:
37         TrainPanel(Engineer &, R2C2::Train &);
38         void expand(bool = true);
39
40 private:
41         void ai_event(const R2C2::TrainAI::Message &);
42         void train_function_changed(unsigned, bool);
43         void train_route_changed(const R2C2::Route *);
44         void train_status_changed(const std::string &);
45         void place_clicked();
46         void take_clicked();
47         void edit_clicked();
48         void route_clicked();
49         void goto_clicked();
50         void view_clicked();
51         void expand_clicked();
52         void speed_slider_changed(double);
53         void forward_toggled(bool);
54         void func_toggled(bool, unsigned);
55         void place(R2C2::Track *, unsigned);
56         void go_to(R2C2::Track *, unsigned);
57 };
58
59 #endif