X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fengineer%2Ftraindialog.h;fp=source%2Fengineer%2Ftraindialog.h;h=e862487baa3665dcb570e80ec636169a50ce9411;hb=b261812f040caed52bc3de783e8bcb86b222a9ed;hp=0000000000000000000000000000000000000000;hpb=fcc044d4eb24820af9acf1431042e4c422366915;p=r2c2.git diff --git a/source/engineer/traindialog.h b/source/engineer/traindialog.h new file mode 100644 index 0000000..e862487 --- /dev/null +++ b/source/engineer/traindialog.h @@ -0,0 +1,41 @@ +#ifndef TRAINDIALOG_H_ +#define TRAINDIALOG_H_ + +#include +#include +#include +#include +#include +#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 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