X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftimecode.cc;h=36a01f90d01eacda6c01c707abc8e6c4750d7e87;hb=3857b8b178d94873a6ffc6f51cdb4c241fd54f90;hp=3e61f02bcdc5ae0d9b44c3f28f4c402a3ae584a1;hpb=2918fd61b33f54269e2143f659d320ff555c4e8a;p=dcpomatic.git diff --git a/src/wx/timecode.cc b/src/wx/timecode.cc index 3e61f02bc..36a01f90d 100644 --- a/src/wx/timecode.cc +++ b/src/wx/timecode.cc @@ -59,16 +59,16 @@ Timecode::Timecode (wxWindow* parent) _frames = new wxTextCtrl (this, wxID_ANY, wxT(""), wxDefaultPosition, size, 0, validator); _frames->SetMaxLength (2); sizer->Add (_frames); - _update_button = new wxButton (this, wxID_ANY, _("Update")); - sizer->Add (_update_button, 0, wxLEFT | wxRIGHT, 8); + _set_button = new wxButton (this, wxID_ANY, _("Set")); + sizer->Add (_set_button, 0, wxLEFT | wxRIGHT, 8); _hours->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (Timecode::changed), 0, this); _minutes->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (Timecode::changed), 0, this); _seconds->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (Timecode::changed), 0, this); _frames->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (Timecode::changed), 0, this); - _update_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (Timecode::update_clicked), 0, this); + _set_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (Timecode::set_clicked), 0, this); - _update_button->Enable (false); + _set_button->Enable (false); SetSizerAndFit (sizer); } @@ -84,10 +84,10 @@ Timecode::set (Time t, int fps) t -= s * TIME_HZ; int const f = t * fps / TIME_HZ; - _hours->SetValue (wxString::Format (wxT ("%d"), h)); - _minutes->SetValue (wxString::Format (wxT ("%d"), m)); - _seconds->SetValue (wxString::Format (wxT ("%d"), s)); - _frames->SetValue (wxString::Format (wxT ("%d"), f)); + checked_set (_hours, lexical_cast (h)); + checked_set (_minutes, lexical_cast (m)); + checked_set (_seconds, lexical_cast (s)); + checked_set (_frames, lexical_cast (f)); } Time @@ -109,12 +109,12 @@ Timecode::get (int fps) const void Timecode::changed (wxCommandEvent &) { - _update_button->Enable (true); + _set_button->Enable (true); } void -Timecode::update_clicked (wxCommandEvent &) +Timecode::set_clicked (wxCommandEvent &) { Changed (); - _update_button->Enable (false); + _set_button->Enable (false); }