]> git.tdb.fi Git - r2c2.git/blobdiff - source/engineer/traindialog.h
Complete rewrite of the engineer UI
[r2c2.git] / source / engineer / traindialog.h
diff --git a/source/engineer/traindialog.h b/source/engineer/traindialog.h
new file mode 100644 (file)
index 0000000..e862487
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef TRAINDIALOG_H_
+#define TRAINDIALOG_H_
+
+#include <msp/gltk/button.h>
+#include <msp/gltk/dialog.h>
+#include <msp/gltk/hslider.h>
+#include <msp/gltk/label.h>
+#include <msp/gltk/toggle.h>
+#include "libr2c2/train.h"
+
+class Engineer;
+
+class TrainDialog: public Msp::GLtk::Dialog, public sigc::trackable
+{
+private:
+       Engineer &engineer;
+       R2C2::Train &train;
+       Msp::GLtk::Label *lbl_title;
+       Msp::GLtk::Button *btn_expand;
+       Msp::GLtk::Label *lbl_speed;
+       Msp::GLtk::Slider *sld_speed;
+       Msp::GLtk::Toggle *tgl_forward;
+       Msp::GLtk::Label *lbl_status;
+       Msp::GLtk::Panel *pnl_expander;
+       std::list<Msp::GLtk::Panel *> panels;
+       bool updating;
+
+public:
+       TrainDialog(Engineer &, R2C2::Train &);
+
+private:
+       void ai_event(R2C2::TrainAI &, const R2C2::TrainAI::Message &);
+       void update_speed_display(float);
+       void ui_speed_changed(double);
+       void update_forward(bool);
+       void ui_forward_toggled(bool);
+       void expand_clicked();
+       void toggle_panel(bool, Msp::GLtk::Panel *);
+};
+
+#endif