+ GLtk::Button *btn;
+
+ 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+=40)
+ {
+ 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);
+ 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;
+ }
+ train.get_locomotive().signal_function_changed.connect(sigc::mem_fun(this, &TrainPanel::loco_function_changed));
+