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"
16 class TrainPanel: public Msp::GLtk::Panel, public sigc::trackable
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;
37 TrainPanel(Engineer &, R2C2::Train &);
38 void expand(bool = true);
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 &);
50 void timetable_clicked();
52 void expand_clicked();
53 void speed_slider_changed(double);
54 void forward_toggled(bool);
55 void func_toggled(bool, unsigned);
56 void place(R2C2::Track *, unsigned);
57 void go_to(R2C2::Track *, unsigned);