]> git.tdb.fi Git - r2c2.git/blob - source/remote/trainpanel.h
Export routes over network
[r2c2.git] / source / remote / trainpanel.h
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2009  Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef TRAINPANEL_H_
9 #define TRAINPANEL_H_
10
11 #include <gtkmm/checkbutton.h>
12 #include <gtkmm/combobox.h>
13 #include <gtkmm/expander.h>
14 #include <gtkmm/label.h>
15 #include <gtkmm/scale.h>
16 #include "network/client.h"
17 #include "network/train.h"
18
19 class TrainPanel: public Gtk::Expander
20 {
21 private:
22         struct RouteRecord: public Gtk::TreeModelColumnRecord
23         {
24                 Gtk::TreeModelColumn<Glib::ustring> name;
25
26                 RouteRecord();
27         };
28
29         Marklin::Client &client;
30         Marklin::NetTrain &train;
31         Gtk::Scale *scl_speed;
32         Gtk::Label *lbl_status;
33         Gtk::CheckButton *chk_reverse;
34         RouteRecord route_columns;
35         Gtk::ComboBox *cmb_route;
36         std::map<unsigned, Gtk::CheckButton *> chk_funcs;
37
38 public:
39         TrainPanel(Marklin::Client &, Marklin::NetTrain &);
40 private:
41         void name_changed(const std::string &);
42         void status_changed(const std::string &);
43         void speed_changed(unsigned);
44         void reverse_changed(bool);
45         void function_changed(unsigned, bool);
46         void route_changed(const std::string &);
47         void ui_speed_changed();
48         void ui_reverse_changed();
49         void ui_function_changed(unsigned);
50         void ui_route_changed();
51 };
52
53 #endif