X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fcontrols.cc;h=b9eebade5317ad96ad488bbf763ca1bd9075ae3f;hb=a399d7c7b9239e055ba08a82b18eb68a511d1025;hp=61c671788cacb2f328b31775e434b664c15f6d6e;hpb=449f383f13e5755c523db11f9adef53b58391025;p=dcpomatic.git diff --git a/src/wx/controls.cc b/src/wx/controls.cc index 61c671788..b9eebade5 100644 --- a/src/wx/controls.cc +++ b/src/wx/controls.cc @@ -28,6 +28,7 @@ #include "playhead_to_frame_dialog.h" #include "playhead_to_timecode_dialog.h" #include "static_text.h" +#include "wx_ptr.h" #include "wx_util.h" #include "lib/content_factory.h" #include "lib/cross.h" @@ -36,6 +37,7 @@ #include "lib/job.h" #include "lib/job_manager.h" #include "lib/player_video.h" +#include "lib/scope_guard.h" #include #include #include @@ -137,7 +139,7 @@ Controls::Controls(wxWindow* parent, FilmViewer& viewer, bool editor_controls) _eye->Bind (wxEVT_CHOICE, boost::bind (&Controls::eye_changed, this)); } if (_outline_content) { - _outline_content->Bind (wxEVT_CHECKBOX, boost::bind (&Controls::outline_content_changed, this)); + _outline_content->bind(&Controls::outline_content_changed, this); } _slider->Bind (wxEVT_SCROLL_THUMBTRACK, boost::bind(&Controls::slider_moved, this, false)); @@ -150,7 +152,7 @@ Controls::Controls(wxWindow* parent, FilmViewer& viewer, bool editor_controls) _frame_number->Bind (wxEVT_LEFT_DOWN, boost::bind(&Controls::frame_number_clicked, this)); _timecode->Bind (wxEVT_LEFT_DOWN, boost::bind(&Controls::timecode_clicked, this)); if (_jump_to_selected) { - _jump_to_selected->Bind (wxEVT_CHECKBOX, boost::bind (&Controls::jump_to_selected_clicked, this)); + _jump_to_selected->bind(&Controls::jump_to_selected_clicked, this); _jump_to_selected->SetValue (Config::instance()->jump_to_selected ()); } @@ -380,22 +382,22 @@ Controls::setup_sensitivity () void Controls::timecode_clicked () { - auto dialog = new PlayheadToTimecodeDialog(this, _viewer.position(), _film->video_frame_rate()); + auto dialog = make_wx(this, _viewer.position(), _film->video_frame_rate()); + if (dialog->ShowModal() == wxID_OK) { _viewer.seek(dialog->get(), true); } - dialog->Destroy (); } void Controls::frame_number_clicked () { - auto dialog = new PlayheadToFrameDialog(this, _viewer.position(), _film->video_frame_rate()); + auto dialog = make_wx(this, _viewer.position(), _film->video_frame_rate()); + if (dialog->ShowModal() == wxID_OK) { _viewer.seek(dialog->get(), true); } - dialog->Destroy (); }