diff options
Diffstat (limited to 'src/wx/timecode.cc')
| -rw-r--r-- | src/wx/timecode.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/wx/timecode.cc b/src/wx/timecode.cc index 856093919..63c119a18 100644 --- a/src/wx/timecode.cc +++ b/src/wx/timecode.cc @@ -26,6 +26,9 @@ using std::string; +#if BOOST_VERSION >= 106100 +using namespace boost::placeholders; +#endif TimecodeBase::TimecodeBase (wxWindow* parent, bool set_button) @@ -75,7 +78,7 @@ TimecodeBase::TimecodeBase (wxWindow* parent, bool set_button) _fixed = add_label_to_sizer(_sizer, this, char_to_wx("42"), false, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL); for (auto control: _controls) { - control->Bind(wxEVT_TEXT, boost::bind(&TimecodeBase::changed, this)); + control->Bind(wxEVT_TEXT, boost::bind(&TimecodeBase::changed, this, _1)); } if (_set_button) { _set_button->Bind (wxEVT_BUTTON, boost::bind (&TimecodeBase::set_clicked, this)); @@ -103,11 +106,25 @@ TimecodeBase::clear () } void -TimecodeBase::changed () +TimecodeBase::changed(wxCommandEvent& ev) { - if (_set_button && !_ignore_changed) { + if (_ignore_changed) { + return; + } + + if (_set_button) { _set_button->Enable(valid()); } + + auto iter = std::find(_controls.begin(), _controls.end(), ev.GetEventObject()); + DCPOMATIC_ASSERT(iter != _controls.end()); + + if ((*iter)->GetValue().Length() == 2) { + auto next = std::next(iter); + if (next != _controls.end()) { + (*next)->SetFocus(); + } + } } void |
