]> git.tdb.fi Git - r2c2.git/blob - source/engineer/trainpanel.h
Add Id tags and copyright notices to files
[r2c2.git] / source / engineer / trainpanel.h
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2008 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/indicator.h>
13 #include <msp/gltk/label.h>
14 #include <msp/gltk/panel.h>
15 #include "libmarklin/train.h"
16
17 class Engineer;
18
19 class TrainPanel: public Msp::GLtk::Panel
20 {
21 private:
22         Engineer &engineer;
23         Marklin::Train &train;
24         Msp::GLtk::Label *lbl_addr;
25         Msp::GLtk::Label *lbl_name;
26         Msp::GLtk::HSlider *sld_speed;
27         Msp::GLtk::Label *lbl_speed;
28         Msp::GLtk::Label *lbl_status;
29         std::map<unsigned, Msp::GLtk::Indicator *> ind_funcs;
30
31 public:
32         TrainPanel(Engineer &, const Msp::GLtk::Resources &, Marklin::Train &);
33 private:
34         void speed_slider_changed(double);
35         void loco_speed_changed(unsigned);
36         void loco_function_changed(unsigned, bool);
37         void train_status_changed(const std::string &);
38         void place_clicked();
39         void func_clicked(unsigned);
40 };
41
42 #endif