]> git.tdb.fi Git - r2c2.git/blobdiff - source/engineer/routerpanel.h
Complete rewrite of the engineer UI
[r2c2.git] / source / engineer / routerpanel.h
diff --git a/source/engineer/routerpanel.h b/source/engineer/routerpanel.h
new file mode 100644 (file)
index 0000000..826e9a7
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef ROUTERPANEL_H_
+#define ROUTERPANEL_H_
+
+#include <msp/gltk/dropdown.h>
+#include <msp/gltk/label.h>
+#include <msp/gltk/panel.h>
+#include "libr2c2/train.h"
+
+class Engineer;
+
+class RouterPanel: public Msp::GLtk::Panel, public sigc::trackable
+{
+private:
+       Engineer &engineer;
+       R2C2::Train &train;
+       Msp::GLtk::Label *lbl_route;
+       Msp::GLtk::FunctionListData<const R2C2::Route *> routes;
+       Msp::GLtk::Dropdown *drp_routes;
+       sigc::connection pick_conn;
+       bool updating;
+
+public:
+       RouterPanel(Engineer &, R2C2::Train &);
+
+private:
+       void ai_event(R2C2::TrainAI &, const R2C2::TrainAI::Message &);
+       void update_route(const R2C2::Route *);
+       void route_selected(unsigned);
+       void goto_clicked();
+       void goto_pick_done(R2C2::Track *, unsigned);
+};
+
+#endif