3 This file is part of R²C²
4 Copyright © 2006-2011 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
11 #include <sigc++/trackable.h>
12 #include <msp/gltk/button.h>
13 #include <msp/gltk/hslider.h>
14 #include <msp/gltk/label.h>
15 #include <msp/gltk/panel.h>
16 #include <msp/gltk/toggle.h>
17 #include "libr2c2/route.h"
18 #include "libr2c2/train.h"
19 #include "libr2c2/trainstatus.h"
23 class TrainPanel: public Msp::GLtk::Panel, public sigc::trackable
28 R2C2::TrainStatus status;
29 Msp::GLtk::Panel *pnl_basic;
30 Msp::GLtk::Panel *pnl_extra;
31 Msp::GLtk::Button *btn_expand;
32 Msp::GLtk::Label *lbl_addr;
33 Msp::GLtk::Label *lbl_name;
34 Msp::GLtk::HSlider *sld_speed;
35 Msp::GLtk::Label *lbl_speed;
36 Msp::GLtk::Label *lbl_route;
37 Msp::GLtk::Label *lbl_status;
38 Msp::GLtk::Toggle *tgl_forward;
39 std::map<unsigned, Msp::GLtk::Toggle *> tgl_funcs;
40 sigc::connection pick_conn;
44 TrainPanel(Engineer &, R2C2::Train &);
45 void expand(bool = true);
48 void ai_event(const R2C2::TrainAI::Message &);
49 void train_function_changed(unsigned, bool);
50 void train_route_changed(const R2C2::Route *);
51 void train_status_changed(const std::string &);
57 void timetable_clicked();
59 void expand_clicked();
60 void speed_slider_changed(double);
61 void forward_toggled(bool);
62 void func_toggled(bool, unsigned);
63 void place(R2C2::Track *, unsigned);
64 void go_to(R2C2::Track *, unsigned);