Fix the jumpto dialog again. Now sets the max possible number of digits to input based on how many digits are in the final frame number. Patch by Harukalover, solves bugtracker issue #804.

Originally committed to SVN as r2723.
This commit is contained in:
Karl Blomster 2009-02-05 14:48:19 +00:00
parent f530b4c0da
commit f85ad3c81f

View file

@ -69,11 +69,13 @@ DialogJumpTo::DialogJumpTo (wxWindow *parent)
ready = false; ready = false;
jumpframe = VideoContext::Get()->GetFrameN(); jumpframe = VideoContext::Get()->GetFrameN();
jumptime.SetMS(VFR_Output.GetTimeAtFrame(jumpframe,true,true)); jumptime.SetMS(VFR_Output.GetTimeAtFrame(jumpframe,true,true));
wxString maxLength = wxString::Format(_T("%i"),VideoContext::Get()->GetLength()-1);
// Times // Times
wxStaticText *LabelFrame = new wxStaticText(this,-1,_("Frame: "),wxDefaultPosition,wxSize(60,20)); wxStaticText *LabelFrame = new wxStaticText(this,-1,_("Frame: "),wxDefaultPosition,wxSize(60,20));
wxStaticText *LabelTime = new wxStaticText(this,-1,_("Time: "),wxDefaultPosition,wxSize(60,20)); wxStaticText *LabelTime = new wxStaticText(this,-1,_("Time: "),wxDefaultPosition,wxSize(60,20));
JumpFrame = new wxTextCtrl(this,TEXT_JUMP_FRAME,wxString::Format(_T("%i"),jumpframe),wxDefaultPosition,wxSize(60,20),wxTE_PROCESS_ENTER); JumpFrame = new wxTextCtrl(this,TEXT_JUMP_FRAME,wxString::Format(_T("%i"),jumpframe),wxDefaultPosition,wxSize(60,20),wxTE_PROCESS_ENTER);
JumpFrame->SetMaxLength(maxLength.Len());
JumpTime = new TimeEdit(this,TEXT_JUMP_TIME,jumptime.GetASSFormated(),wxDefaultPosition,wxSize(60,20),wxTE_PROCESS_ENTER); JumpTime = new TimeEdit(this,TEXT_JUMP_TIME,jumptime.GetASSFormated(),wxDefaultPosition,wxSize(60,20),wxTE_PROCESS_ENTER);
wxSizer *FrameSizer = new wxBoxSizer(wxHORIZONTAL); wxSizer *FrameSizer = new wxBoxSizer(wxHORIZONTAL);
wxSizer *TimeSizer = new wxBoxSizer(wxHORIZONTAL); wxSizer *TimeSizer = new wxBoxSizer(wxHORIZONTAL);