- add(*(btn=new GLtk::Button(res, "Cncl")));
- btn->set_style("red");
- btn->set_geometry(GLtk::Geometry(geom.w-80, 10, 30, 25));
- btn->signal_clicked.connect(sigc::mem_fun(this, &TrainProperties::cancel_clicked));
+ drp_new_vehicle->append(format("%d %s", i->second->get_article_number(), i->second->get_name()));
+ }
+ drp_new_vehicle->signal_item_selected.connect(sigc::mem_fun(this, &TrainProperties::new_vehicle_selected));
+
+ if(train)
+ {
+ ent_addr->set_text(lexical_cast(train->get_address()));
+ ent_name->set_text(train->get_name());
+ drp_priority->set_selected_index(train->get_priority()+2);
+
+ unsigned n_vehicles = train->get_n_vehicles();
+ for(unsigned i=1; i<n_vehicles; ++i)
+ {
+ const VehicleType &type = train->get_vehicle(i).get_type();
+ lst_vehicles->append(format("%d %s", type.get_article_number(), type.get_name()));
+ }
+ }
+ else
+ {
+ ent_name->set_text(format("Train %d", engineer.get_layout().get_trains().size()+1));
+ drp_priority->set_selected_index(2);
+ }