X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftimecode.cc;h=754483c0c2ce08407bc11c9d4af682937ac1f095;hb=350afcbc40fffd8c8780180e153a2ee91088f562;hp=8db6050943caff69504ff09324650251a2fa4282;hpb=b8693a3bf32380733604aa6e80c9774de575ebe7;p=dcpomatic.git diff --git a/src/wx/timecode.cc b/src/wx/timecode.cc index 8db605094..754483c0c 100644 --- a/src/wx/timecode.cc +++ b/src/wx/timecode.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2016 Carl Hetherington + Copyright (C) 2013-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -18,9 +18,10 @@ */ -#include "lib/util.h" #include "timecode.h" #include "wx_util.h" +#include "dcpomatic_button.h" +#include "lib/util.h" #include using std::string; @@ -62,7 +63,7 @@ TimecodeBase::TimecodeBase (wxWindow* parent, bool set_button) _frames->SetMaxLength (2); editable_sizer->Add (_frames); if (set_button) { - _set_button = new wxButton (_editable, wxID_ANY, _("Set")); + _set_button = new Button (_editable, _("Set")); editable_sizer->Add (_set_button, 0, wxLEFT | wxRIGHT, 8); } _editable->SetSizerAndFit (editable_sizer); @@ -70,12 +71,12 @@ TimecodeBase::TimecodeBase (wxWindow* parent, bool set_button) _fixed = add_label_to_sizer (_sizer, this, wxT ("42"), false); - _hours->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&TimecodeBase::changed, this)); - _minutes->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&TimecodeBase::changed, this)); - _seconds->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&TimecodeBase::changed, this)); - _frames->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&TimecodeBase::changed, this)); + _hours->Bind (wxEVT_TEXT, boost::bind (&TimecodeBase::changed, this)); + _minutes->Bind (wxEVT_TEXT, boost::bind (&TimecodeBase::changed, this)); + _seconds->Bind (wxEVT_TEXT, boost::bind (&TimecodeBase::changed, this)); + _frames->Bind (wxEVT_TEXT, boost::bind (&TimecodeBase::changed, this)); if (_set_button) { - _set_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&TimecodeBase::set_clicked, this)); + _set_button->Bind (wxEVT_BUTTON, boost::bind (&TimecodeBase::set_clicked, this)); _set_button->Enable (false); } @@ -84,6 +85,12 @@ TimecodeBase::TimecodeBase (wxWindow* parent, bool set_button) SetSizerAndFit (_sizer); } +void +TimecodeBase::set_focus () +{ + _hours->SetFocus (); +} + void TimecodeBase::clear () {