]> git.tdb.fi Git - r2c2.git/blob - source/engineer/timetablepanel.h
Sync timetable on clock discontinuity
[r2c2.git] / source / engineer / timetablepanel.h
1 #ifndef TIMETABLEPANEL_H_
2 #define TIMETABLEPANEL_H_
3
4 #include <msp/gltk/dropdown.h>
5 #include <msp/gltk/entry.h>
6 #include <msp/gltk/label.h>
7 #include <msp/gltk/list.h>
8 #include <msp/gltk/panel.h>
9 #include "libr2c2/timetable.h"
10 #include "libr2c2/train.h"
11 #include "3d/trackchain.h"
12
13 class Engineer;
14
15 class TimetablePanel: public Msp::GLtk::Panel, public sigc::trackable
16 {
17 private:
18         Engineer &engineer;
19         R2C2::Train &train;
20         R2C2::Timetable *timetable;
21         Msp::GLtk::List *lst_timetable;
22         Msp::GLtk::Dropdown *drp_type;
23         R2C2::TrackChain *target;
24         Msp::GLtk::Label *lbl_target;
25         Msp::GLtk::Entry *ent_time;
26         Msp::GLtk::Dropdown *drp_direction;
27         Msp::GLtk::BasicListData<const R2C2::Timetable::Row *> rows;
28
29         bool target_pick;
30         R2C2::TrackChain *picked_target;
31         R2C2::TrackChain3D *pick_highlight;
32         bool shift;
33
34 public:
35         TimetablePanel(Engineer &, R2C2::Train &);
36
37 private:
38         void row_added(unsigned, const R2C2::Timetable::Row &);
39         void row_modified(unsigned, const R2C2::Timetable::Row &);
40         void row_removed(unsigned);
41         R2C2::Timetable::Row create_row();
42
43         void row_selected(unsigned);
44         void pick_clicked();
45         void insert_clicked();
46         void delete_clicked();
47         void apply_clicked();
48
49         virtual void key_press(unsigned, unsigned);
50         virtual void key_release(unsigned, unsigned);
51         virtual void button_press(int, int, unsigned);
52         virtual void pointer_motion(int, int);
53 };
54
55 #endif