X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fengineer%2Ftrainpanel.cpp;h=b47093468cac16197a4bd890fe588f4010efb902;hb=38fb8d56efde037a71c46a58bda314655e68ab6c;hp=9f3bf1a95f1c8303b8b6b432c6803f19326d3e4f;hpb=3e9c210ddc036cd015228504cc0803c909e27f84;p=r2c2.git diff --git a/source/engineer/trainpanel.cpp b/source/engineer/trainpanel.cpp index 9f3bf1a..b470934 100644 --- a/source/engineer/trainpanel.cpp +++ b/source/engineer/trainpanel.cpp @@ -44,21 +44,21 @@ TrainPanel::TrainPanel(Engineer &e, const GLtk::Resources &r, Train &t): GLtk::Button *btn; - const map &funcs=train.get_locomotive().get_type().get_functions(); - unsigned x=10; + const map &funcs = train.get_locomotive().get_type().get_functions(); + unsigned x = 10; for(map::const_iterator i=funcs.begin(); i!=funcs.end(); ++i, x+=40) { - string fname=i->second; - fname[0]=toupper(fname[0]); + string fname = i->second; + fname[0] = toupper(fname[0]); add(*(btn=new GLtk::Button(res, fname))); btn->set_geometry(GLtk::Geometry(x, 68, 40, 24)); btn->signal_clicked.connect(sigc::bind(sigc::mem_fun(this, &TrainPanel::func_clicked), i->first)); - GLtk::Indicator *ind=new GLtk::Indicator(res); + GLtk::Indicator *ind = new GLtk::Indicator(res); add(*ind); ind->set_geometry(GLtk::Geometry(x, 92, 40, 12)); ind->set_active(train.get_locomotive().get_function(i->first)); - ind_funcs[i->first]=ind; + ind_funcs[i->first] = ind; } train.get_locomotive().signal_function_changed.connect(sigc::mem_fun(this, &TrainPanel::loco_function_changed)); @@ -87,7 +87,7 @@ void TrainPanel::loco_speed_changed(unsigned speed) void TrainPanel::loco_function_changed(unsigned func, bool value) { - map::iterator i=ind_funcs.find(func); + map::iterator i = ind_funcs.find(func); if(i!=ind_funcs.end()) i->second->set_active(value); }