Supporters update.
[dcpomatic.git] / src / wx / time_picker.h
1 /*
2     Copyright (C) 2016-2020 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21
22 #include <dcp/warnings.h>
23 LIBDCP_DISABLE_WARNINGS
24 #include <wx/wx.h>
25 LIBDCP_ENABLE_WARNINGS
26 #include <boost/signals2.hpp>
27
28 class wxSpinCtrl;
29
30
31 class TimePicker : public wxPanel
32 {
33 public:
34         TimePicker (wxWindow* parent);
35
36         virtual int hours () const = 0;
37         virtual int minutes () const = 0;
38
39         boost::signals2::signal<void ()> Changed;
40 };
41
42
43 class TimePickerSpin : public TimePicker
44 {
45 public:
46         TimePickerSpin (wxWindow* parent, wxDateTime time);
47
48         int hours () const override;
49         int minutes () const override;
50
51 private:
52         void changed ();
53
54         wxSpinCtrl* _hours;
55         wxSpinCtrl* _minutes;
56 };
57
58
59 class TimePickerText : public TimePicker
60 {
61 public:
62         TimePickerText (wxWindow* parent, wxDateTime time);
63
64         int hours () const override;
65         int minutes () const override;
66
67 private:
68         void changed ();
69
70         wxTextCtrl* _hours;
71         wxTextCtrl* _minutes;
72 };