+ add(*(tgl_forward=new GLtk::Toggle(res)));
+ tgl_forward->set_text("Fwd");
+ tgl_forward->set_geometry(GLtk::Geometry(geom.w-30, geom.h-59, 20, 27));
+ tgl_forward->set_value(!train.get_locomotive().get_reverse());
+ tgl_forward->signal_toggled.connect(sigc::mem_fun(this, &TrainPanel::forward_toggled));
+
+ add(*(lbl_status=new GLtk::Label(res, train.get_status())));
+ lbl_status->set_style("digital");
+ lbl_status->set_geometry(GLtk::Geometry(10, 34, geom.w-20, 24));
+ train.signal_status_changed.connect(sigc::mem_fun(this, &TrainPanel::train_status_changed));
+
+ 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));
+
+ GLtk::Button *btn;
+
+ add(*(btn=new GLtk::Button(res, "Edit")));
+ btn->set_geometry(GLtk::Geometry(geom.w-50, 10, 40, 24));
+