]> git.tdb.fi Git - r2c2.git/blob - source/engineer/departuresdialog.h
9dc99b84922a145ca1b6a161dd9f36f1036e64c8
[r2c2.git] / source / engineer / departuresdialog.h
1 #ifndef DEPARTURESDIALOG_H_
2 #define DEPARTURESDIALOG_H_
3
4 #include <msp/gltk/dialog.h>
5 #include <msp/gltk/dropdown.h>
6 #include <msp/gltk/label.h>
7 #include "libr2c2/departures.h"
8
9 class DeparturesDialog: public Msp::GLtk::Dialog
10 {
11 private:
12         struct Row
13         {
14                 const R2C2::Departures::Departure *departure;
15                 Msp::GLtk::Label *lbl_time;
16                 Msp::GLtk::Label *lbl_train;
17
18                 Row();
19
20                 void set_departure(const R2C2::Departures::Departure *);
21         };
22
23         const R2C2::Layout &layout;
24         Msp::GLtk::Dropdown *drp_groups;
25         Msp::GLtk::Label *lbl_title;
26         Msp::GLtk::BasicListData<std::string> groups;
27         Msp::GLtk::Panel *pnl_departures;
28         R2C2::Departures *departures;
29         std::vector<Row> rows;
30
31 public:
32         DeparturesDialog(const R2C2::Layout &, const std::string & = std::string());
33
34 private:
35         void group_selected(unsigned);
36         void departure_added(const R2C2::Departures::Departure &);
37         void departure_removed(const R2C2::Departures::Departure &);
38         void update_rows();
39 };
40
41 #endif