#include "libr2c2/layout.h"
#include "libr2c2/trainstatus.h"
#include "controlpanel.h"
+#include "engineer.h"
#include "routerpanel.h"
#include "timetablepanel.h"
#include "traindialog.h"
using namespace R2C2;
TrainDialog::TrainDialog(Engineer &e, R2C2::Train &t):
+ DynamicDialog(e.get_user_interface()),
engineer(e),
train(t),
updating(false)
{
panel->set_visible(show);
}
+
+bool TrainDialog::save_state(DataFile::Statement &st) const
+{
+ st.keyword = "traindialog";
+ st.append(train.get_address());
+ st.sub.push_back((DataFile::Statement("expanded"), pnl_expander->is_visible()));
+ save_position(st.sub);
+
+ return true;
+}
+
+
+TrainDialog::StateLoader::StateLoader(TrainDialog &td):
+ DataFile::DerivedObjectLoader<TrainDialog, DynamicDialog::StateLoader>(td)
+{
+ add("expanded", &StateLoader::expanded);
+}
+
+void TrainDialog::StateLoader::expanded(bool e)
+{
+ obj.set_expanded(e);
+}