+ add(*(ent_name=new GLtk::Entry(res)));
+ ent_name->set_geometry(GLtk::Geometry(10, geom.h-75, geom.w-20, 20));
+
+ if(train)
+ {
+ ent_addr->set_text(lexical_cast(train->get_locomotive().get_address()));
+ ent_name->set_text(train->get_name());
+ }
+ else
+ ent_name->set_text(format("Train %d", engineer.get_traffic_manager().get_trains().size()+1));
+}
+
+void TrainProperties::on_ok_clicked()
+{
+ if(!train)
+ {
+ const map<unsigned, LocoType *> &locos = engineer.get_catalogue().get_locomotives();
+ map<unsigned, LocoType *>::const_iterator i = locos.begin();
+ advance(i, drp_type->get_selected_index());