X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fremote%2Ftrainpanel.cpp;h=26963a0537d6200af841108449669d1eba32c31b;hb=df88ff837468c32986c73740b4fc8279bc152e47;hp=b170edc5ff8e4df910fae410f32543b525d61069;hpb=02fe62e0026dd25fd3ff4d5172c0ff097b7c68c9;p=r2c2.git diff --git a/source/remote/trainpanel.cpp b/source/remote/trainpanel.cpp index b170edc..26963a0 100644 --- a/source/remote/trainpanel.cpp +++ b/source/remote/trainpanel.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of the MSP Märklin suite -Copyright © 2009-2010 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #include #include #include "remote.h" @@ -12,7 +5,7 @@ Distributed under the GPL using namespace std; -TrainPanel::TrainPanel(Remote &r, Marklin::Client &c, Marklin::NetTrain &t): +TrainPanel::TrainPanel(Remote &r, R2C2::Client &c, R2C2::NetTrain &t): remote(r), client(c), train(t) @@ -32,20 +25,20 @@ TrainPanel::TrainPanel(Remote &r, Marklin::Client &c, Marklin::NetTrain &t): Gtk::HBox *hbox = new Gtk::HBox(false, 5); vbox->add(*manage(hbox)); - hbox->add(*manage(scl_speed = new Gtk::HScale)); + hbox->pack_start(*manage(scl_speed = new Gtk::HScale), true, true); scl_speed->set_digits(0); scl_speed->set_range(0, 200); scl_speed->set_increments(5, 5); scl_speed->set_size_request(210, -1); scl_speed->signal_value_changed().connect(sigc::mem_fun(this, &TrainPanel::ui_speed_changed)); - hbox->add(*manage(chk_reverse = new Gtk::CheckButton("Rev"))); + hbox->pack_start(*manage(chk_reverse = new Gtk::CheckButton("Rev")), false, true); chk_reverse->signal_toggled().connect(sigc::mem_fun(this, &TrainPanel::ui_reverse_changed)); Gtk::HBox *func_box = new Gtk::HBox(false, 5); vbox->add(*manage(func_box)); - const std::map &funcs = train.get_loco_type().get_functions(); - for(std::map::const_iterator i=funcs.begin(); i!=funcs.end(); ++i) + const R2C2::VehicleType::FunctionMap &funcs = train.get_loco_type().get_functions(); + for(R2C2::VehicleType::FunctionMap::const_iterator i=funcs.begin(); i!=funcs.end(); ++i) { Gtk::CheckButton *&chk = chk_funcs[i->first]; chk = new Gtk::CheckButton(i->second); @@ -54,7 +47,7 @@ TrainPanel::TrainPanel(Remote &r, Marklin::Client &c, Marklin::NetTrain &t): } Glib::RefPtr route_store = Gtk::ListStore::create(route_columns); - vbox->add(*manage(cmb_route = new Gtk::ComboBox(route_store))); + vbox->add(*manage(cmb_route = new Gtk::ComboBox(static_cast &>(route_store)))); cmb_route->pack_start(route_columns.name); route_store->append(); const list &routes = client.get_routes();