X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftime_picker.h;h=53b0ce2b8886214128ce476b1de2c2efe6f1f05d;hb=295076f7bf8d84d19f22a073814968aab76aebcc;hp=80888301031f18f2599bf5fddc8654cf319aae1d;hpb=5b7c8b06f7d9ea910020b4620c234cf0dce95a66;p=dcpomatic.git diff --git a/src/wx/time_picker.h b/src/wx/time_picker.h index 808883010..53b0ce2b8 100644 --- a/src/wx/time_picker.h +++ b/src/wx/time_picker.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2016 Carl Hetherington + Copyright (C) 2016-2020 Carl Hetherington This file is part of DCP-o-matic. @@ -18,30 +18,54 @@ */ +#include "lib/warnings.h" +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include -class wxTextCtrl; -class wxSpinButton; +class wxSpinCtrl; + class TimePicker : public wxPanel { public: - TimePicker (wxWindow* parent, wxDateTime time); + TimePicker (wxWindow* parent); + + virtual int hours () const = 0; + virtual int minutes () const = 0; + + boost::signals2::signal Changed; +}; + + +class TimePickerSpin : public TimePicker +{ +public: + TimePickerSpin (wxWindow* parent, wxDateTime time); int hours () const; int minutes () const; - boost::signals2::signal Changed; +private: + void changed (); + + wxSpinCtrl* _hours; + wxSpinCtrl* _minutes; +}; + + +class TimePickerText : public TimePicker +{ +public: + TimePickerText (wxWindow* parent, wxDateTime time); + + int hours () const; + int minutes () const; private: - void update_spin (); - void update_text (); + void changed (); wxTextCtrl* _hours; - wxSpinButton* _hours_spin; wxTextCtrl* _minutes; - wxSpinButton* _minutes_spin; - - bool _block_update; };