]> git.tdb.fi Git - r2c2.git/blob - source/engineer/trainpanel.h
Convert svn:ignore to .gitignore
[r2c2.git] / source / engineer / trainpanel.h
1 /* $Id$
2
3 This file is part of R²C²
4 Copyright © 2006-2011  Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef TRAINPANEL_H_
9 #define TRAINPANEL_H_
10
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"
20
21 class Engineer;
22
23 class TrainPanel: public Msp::GLtk::Panel, public sigc::trackable
24 {
25 private:
26         Engineer &engineer;
27         R2C2::Train &train;
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;
41         bool expanded;
42
43 public:
44         TrainPanel(Engineer &, R2C2::Train &);
45         void expand(bool = true);
46
47 private:
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 &);
52         void place_clicked();
53         void take_clicked();
54         void edit_clicked();
55         void route_clicked();
56         void goto_clicked();
57         void timetable_clicked();
58         void view_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);
65 };
66
67 #endif