+/* $Id$
+
+This file is part of R²C²
+Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
#ifndef TRAINPROPERTIES_H_
#define TRAINPROPERTIES_H_
+#include <msp/gltk/dropdown.h>
#include <msp/gltk/entry.h>
-#include <msp/gltk/panel.h>
-#include <libmarklin/train.h>
+#include <libr2c2/train.h>
+#include "dialog.h"
class Engineer;
-class TrainProperties: public Msp::GLtk::Panel
+class TrainProperties: public Dialog
{
private:
Engineer &engineer;
- Marklin::Train *train;
+ R2C2::Train *train;
Msp::GLtk::Entry *ent_addr;
+ Msp::GLtk::Dropdown *drp_protocol;
+ Msp::GLtk::Dropdown *drp_type;
Msp::GLtk::Entry *ent_name;
+ Msp::GLtk::Dropdown *drp_priority;
+ Msp::GLtk::List *lst_vehicles;
+ Msp::GLtk::Dropdown *drp_new_vehicle;
+ std::vector<const R2C2::VehicleType *> add_vehicles;
+ std::set<unsigned> rem_vehicles;
public:
- sigc::signal<void> signal_ok;
-
- TrainProperties(Engineer &, Msp::GLtk::Resources &, Marklin::Train *);
+ TrainProperties(Engineer &, R2C2::Train *);
private:
- void ok_clicked();
+ virtual void on_ok_clicked();
+ void new_vehicle_selected(unsigned, const std::string &);
+ void remove_vehicle_clicked();
+ const R2C2::VehicleType &get_vehicle_type(unsigned, bool);
};
#endif