]> git.tdb.fi Git - r2c2.git/blob - source/remote/trainpanel.h
Some other minor UI tweaks
[r2c2.git] / source / remote / trainpanel.h
1 #ifndef TRAINPANEL_H_
2 #define TRAINPANEL_H_
3
4 #include <gtkmm/checkbutton.h>
5 #include <gtkmm/combobox.h>
6 #include <gtkmm/expander.h>
7 #include <gtkmm/label.h>
8 #include <gtkmm/scale.h>
9 #include "network/client.h"
10 #include "network/train.h"
11
12 class Remote;
13
14 class TrainPanel: public Gtk::Expander
15 {
16 private:
17         struct RouteRecord: public Gtk::TreeModelColumnRecord
18         {
19                 Gtk::TreeModelColumn<Glib::ustring> name;
20
21                 RouteRecord();
22         };
23
24         Remote &remote;
25         R2C2::Client &client;
26         R2C2::NetTrain &train;
27         Gtk::Scale *scl_speed;
28         Gtk::Label *lbl_status;
29         Gtk::CheckButton *chk_reverse;
30         RouteRecord route_columns;
31         Gtk::ComboBox *cmb_route;
32         std::map<unsigned, Gtk::CheckButton *> chk_funcs;
33
34 public:
35         TrainPanel(Remote &, R2C2::Client &, R2C2::NetTrain &);
36 private:
37         void name_changed(const std::string &);
38         void status_changed(const std::string &);
39         void control_changed(const std::string &, float);
40         void function_changed(unsigned, bool);
41         void route_changed(const std::string &);
42         void ui_speed_changed();
43         void ui_reverse_changed();
44         void ui_function_changed(unsigned);
45         void ui_route_changed();
46 };
47
48 #endif