diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-01-09 21:53:38 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-01-09 21:53:38 +0000 |
| commit | 772c2476431ebf42ac83b371cd7edbc9717248f9 (patch) | |
| tree | 1145e3b122b409a4f2c31cbc19bff6a3c31792f4 /src/wx/timecode.cc | |
| parent | cc10bdda89782bcce39952c5b740d3a6c9598600 (diff) | |
Hand-apply d7329603f8698f5302d11acfc233ca67695e654d from master; timecode labelling.
Diffstat (limited to 'src/wx/timecode.cc')
| -rw-r--r-- | src/wx/timecode.cc | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/wx/timecode.cc b/src/wx/timecode.cc index bd0a182c2..fe6819cd0 100644 --- a/src/wx/timecode.cc +++ b/src/wx/timecode.cc @@ -29,10 +29,8 @@ using boost::lexical_cast; TimecodeBase::TimecodeBase (wxWindow* parent) : wxPanel (parent) { - wxClientDC dc (parent); - wxSize size = dc.GetTextExtent (wxT ("9999")); - size.SetHeight (-1); - + wxSize const s = TimecodeBase::size (parent); + wxTextValidator validator (wxFILTER_INCLUDE_CHAR_LIST); wxArrayString list; @@ -47,19 +45,19 @@ TimecodeBase::TimecodeBase (wxWindow* parent) _editable = new wxPanel (this); wxSizer* editable_sizer = new wxBoxSizer (wxHORIZONTAL); - _hours = new wxTextCtrl (_editable, wxID_ANY, wxT(""), wxDefaultPosition, size, 0, validator); + _hours = new wxTextCtrl (_editable, wxID_ANY, wxT(""), wxDefaultPosition, s, 0, validator); _hours->SetMaxLength (2); editable_sizer->Add (_hours); add_label_to_sizer (editable_sizer, _editable, wxT (":"), false); - _minutes = new wxTextCtrl (_editable, wxID_ANY, wxT(""), wxDefaultPosition, size, 0, validator); + _minutes = new wxTextCtrl (_editable, wxID_ANY, wxT(""), wxDefaultPosition, s, 0, validator); _minutes->SetMaxLength (2); editable_sizer->Add (_minutes); add_label_to_sizer (editable_sizer, _editable, wxT (":"), false); - _seconds = new wxTextCtrl (_editable, wxID_ANY, wxT(""), wxDefaultPosition, size, 0, validator); + _seconds = new wxTextCtrl (_editable, wxID_ANY, wxT(""), wxDefaultPosition, s, 0, validator); _seconds->SetMaxLength (2); editable_sizer->Add (_seconds); add_label_to_sizer (editable_sizer, _editable, wxT (":"), false); - _frames = new wxTextCtrl (_editable, wxID_ANY, wxT(""), wxDefaultPosition, size, 0, validator); + _frames = new wxTextCtrl (_editable, wxID_ANY, wxT(""), wxDefaultPosition, s, 0, validator); _frames->SetMaxLength (2); editable_sizer->Add (_frames); _set_button = new wxButton (_editable, wxID_ANY, _("Set")); @@ -112,3 +110,14 @@ TimecodeBase::set_editable (bool e) _fixed->Show (!e); _sizer->Layout (); } + +wxSize +TimecodeBase::size (wxWindow* parent) +{ + wxClientDC dc (parent); + wxSize size = dc.GetTextExtent (wxT ("9999")); + size.SetHeight (-1); + return size; +} + + |
