+ const map<unsigned, string> &funcs = train.get_locomotive().get_type().get_functions();
+ unsigned x = 10;
+ for(map<unsigned, string>::const_iterator i=funcs.begin(); i!=funcs.end(); ++i, x+=35)
+ {
+ string fname = i->second;
+ fname[0] = toupper(fname[0]);
+ GLtk::Toggle *tgl;
+ add(*(tgl=new GLtk::Toggle(res)));
+ tgl->set_text(fname);
+ tgl->set_geometry(GLtk::Geometry(x, geom.h-85, 35, 27));
+ tgl->set_value(train.get_locomotive().get_function(i->first));
+ tgl->signal_toggled.connect(sigc::bind(sigc::mem_fun(this, &TrainPanel::func_toggled), i->first));
+
+ tgl_funcs[i->first] = tgl;
+ }
+ train.get_locomotive().signal_function_changed.connect(sigc::mem_fun(this, &TrainPanel::loco_function_changed));
+