3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2010 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 "libmarklin/route.h"
18 #include "libmarklin/train.h"
22 class TrainPanel: public Msp::GLtk::Panel, public sigc::trackable
26 Marklin::Train &train;
27 Msp::GLtk::Panel *pnl_basic;
28 Msp::GLtk::Panel *pnl_extra;
29 Msp::GLtk::Button *btn_expand;
30 Msp::GLtk::Label *lbl_addr;
31 Msp::GLtk::Label *lbl_name;
32 Msp::GLtk::HSlider *sld_speed;
33 Msp::GLtk::Label *lbl_speed;
34 Msp::GLtk::Label *lbl_route;
35 Msp::GLtk::Label *lbl_status;
36 Msp::GLtk::Toggle *tgl_forward;
37 std::map<unsigned, Msp::GLtk::Toggle *> tgl_funcs;
38 sigc::connection pick_conn;
42 TrainPanel(Engineer &, const Msp::GLtk::Resources &, Marklin::Train &);
43 void expand(bool = true);
46 void train_control_changed(const std::string &, float);
47 void train_function_changed(unsigned, bool);
48 void train_route_changed(const Marklin::Route *);
49 void train_status_changed(const std::string &);
55 void timetable_clicked();
57 void expand_clicked();
58 void speed_slider_changed(double);
59 void forward_toggled(bool);
60 void func_toggled(bool, unsigned);
61 void place(Marklin::Track *, unsigned);
62 void go_to(Marklin::Track *, unsigned);