X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Fwx%2Fplayhead_to_frame_dialog.cc;h=b4c4b1030bd2b787d171228546e643f784c5af8c;hp=bb3c5b5fb022177cb28d240230349ac93ed50139;hb=8f12e84009d7c2685bb2eeb32665876463d4e6e5;hpb=ee37079f77166aaa309ffe7b3475b4f79f88eaa8 diff --git a/src/wx/playhead_to_frame_dialog.cc b/src/wx/playhead_to_frame_dialog.cc index bb3c5b5fb..b4c4b1030 100644 --- a/src/wx/playhead_to_frame_dialog.cc +++ b/src/wx/playhead_to_frame_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2016 Carl Hetherington + Copyright (C) 2016-2020 Carl Hetherington This file is part of DCP-o-matic. @@ -19,14 +19,21 @@ */ #include "playhead_to_frame_dialog.h" -#include "lib/raw_convert.h" +#include -PlayheadToFrameDialog::PlayheadToFrameDialog (wxWindow* parent, int fps) - : TableDialog (parent, _("Move to frame"), 2, 1, true) +using std::string; +using dcp::locale_convert; +using namespace dcpomatic; + +PlayheadToFrameDialog::PlayheadToFrameDialog (wxWindow* parent, DCPTime time, int fps) + : TableDialog (parent, _("Go to frame"), 2, 1, true) , _fps (fps) { add (_("Go to"), true); _frame = add (new wxTextCtrl (this, wxID_ANY, wxT (""))); + _frame->SetFocus (); + _frame->SetValue (std_to_wx(locale_convert(time.frames_round(fps) + 1))); + _frame->SetSelection (-1, -1); layout (); } @@ -34,5 +41,5 @@ PlayheadToFrameDialog::PlayheadToFrameDialog (wxWindow* parent, int fps) DCPTime PlayheadToFrameDialog::get () const { - return DCPTime::from_frames (raw_convert (wx_to_std (_frame->GetValue ())) - 1, _fps); + return DCPTime::from_frames (locale_convert (wx_to_std (_frame->GetValue ())) - 1, _fps); }