- if(const GLtk::Part *part = style->get_part("children"))
- {
- const GLtk::Sides &margin = part->get_margin();
- address.set_position(margin.left, margin.bottom);
- name.set_position(margin.left+30, margin.bottom);
- }
+void TrainListDialog::train_removed(Train &train)
+{
+ int i = trains.find(&train);
+ if(i>=0)
+ trains.remove(i);
+}
+
+void TrainListDialog::train_name_changed(Train &train)
+{
+ trains.refresh(&train);
+}
+
+bool TrainListDialog::save_state(DataFile::Statement &st) const
+{
+ st.keyword = "trainlistdialog";
+ save_position(st.sub);
+
+ return true;
+}
+
+
+TrainItem::TrainItem(ValueType train)
+{
+ add(*new GLtk::Label(train->get_protocol()));
+ add(*new GLtk::Label(lexical_cast<string>(train->get_address())));
+ add(*new GLtk::Label(train->get_name()));
+}
+
+
+DetectedLocoItem::DetectedLocoItem(ValueType loco)
+{
+ add(*new GLtk::Label(loco->protocol));
+ add(*new GLtk::Label(lexical_cast<string>(loco->address)));
+ add(*new GLtk::Label(loco->name));