]> git.tdb.fi Git - r2c2.git/blob - source/engineer/trainpanel.h
Export routes over network
[r2c2.git] / source / engineer / trainpanel.h
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef TRAINPANEL_H_
9 #define TRAINPANEL_H_
10
11 #include <msp/gltk/hslider.h>
12 #include <msp/gltk/label.h>
13 #include <msp/gltk/panel.h>
14 #include <msp/gltk/toggle.h>
15 #include "libmarklin/route.h"
16 #include "libmarklin/train.h"
17
18 class Engineer;
19
20 class TrainPanel: public Msp::GLtk::Panel
21 {
22 private:
23         Engineer &engineer;
24         Marklin::Train &train;
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
34 public:
35         TrainPanel(Engineer &, const Msp::GLtk::Resources &, Marklin::Train &);
36 private:
37         void speed_slider_changed(double);
38         void train_speed_changed(unsigned);
39         void train_reverse_changed(bool);
40         void loco_function_changed(unsigned, bool);
41         void train_route_changed(const Marklin::Route *);
42         void train_status_changed(const std::string &);
43         void place_clicked();
44         void edit_clicked();
45         void route_clicked();
46         void forward_toggled(bool);
47         void func_toggled(bool, unsigned);
48 };
49
50 #endif