]> git.tdb.fi Git - r2c2.git/blob - source/engineer/mainwindow.h
Keep UI better in sync with the clock
[r2c2.git] / source / engineer / mainwindow.h
1 #ifndef MAINWINDOW_H_
2 #define MAINWINDOW_H_
3
4 #include <sigc++/trackable.h>
5 #include <msp/gltk/indicator.h>
6 #include <msp/gltk/label.h>
7 #include <msp/gltk/panel.h>
8
9 class Engineer;
10
11 class MainWindow: public Msp::GLtk::Panel, public sigc::trackable
12 {
13 private:
14         Engineer &engineer;
15         Msp::GLtk::Indicator *ind_on;
16         Msp::GLtk::Indicator *ind_off;
17         Msp::GLtk::Indicator *ind_halt;
18         Msp::GLtk::Label *lbl_status;
19         Msp::GLtk::Label *lbl_clock;
20
21 public:
22         MainWindow(Engineer &);
23
24         void set_status_text(const std::string &);
25 private:
26         void on_clicked();
27         void off_clicked();
28         void halt_clicked();
29         void trains_clicked();
30         void telemetry_clicked();
31         void quit_clicked();
32         void clock_clicked();
33         void power_event(bool);
34         void halt_event(bool);
35         void update_clock();
36 };
37
38 #endif