- Gtk::HBox *func_box = new Gtk::HBox(false, 5);
- vbox->add(*manage(func_box));
- const std::map<unsigned, string> &funcs = train.get_loco_type().get_functions();
- for(std::map<unsigned, string>::const_iterator i=funcs.begin(); i!=funcs.end(); ++i)
- {
- Gtk::CheckButton *&chk = chk_funcs[i->first];
- chk = new Gtk::CheckButton(i->second);
- func_box->pack_start(*manage(chk), false, true);
- chk->signal_toggled().connect(sigc::bind(sigc::mem_fun(this, &TrainPanel::ui_function_changed), i->first));
- }
-
- Glib::RefPtr<Gtk::ListStore> route_store = Gtk::ListStore::create(route_columns);
- vbox->add(*manage(cmb_route = new Gtk::ComboBox(route_store)));
- cmb_route->pack_start(route_columns.name);
- route_store->append();
- const list<string> &routes = client.get_routes();
- for(list<string>::const_iterator i=routes.begin(); i!=routes.end(); ++i)
- {
- Gtk::TreeIter iter = route_store->append();
- (*iter)[route_columns.name] = *i;
- }
- cmb_route->signal_changed().connect(sigc::mem_fun(this, &TrainPanel::ui_route_changed));
+ sld_speed = dynamic_cast<GLtk::Slider *>(get_item(widgets, "sld_speed"));
+ sld_speed->set_range(0, train.get_loco_type().get_maximum_speed()/train.get_client().get_catalogue().get_scale()*3.6);
+ sld_speed->signal_value_changed.connect(sigc::mem_fun(this, &TrainPanel::ui_speed_changed));