From f85ad3c81f368c38e7e0f7e3c6dead9b175ec050 Mon Sep 17 00:00:00 2001 From: Karl Blomster Date: Thu, 5 Feb 2009 14:48:19 +0000 Subject: [PATCH] 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. --- aegisub/dialog_jumpto.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aegisub/dialog_jumpto.cpp b/aegisub/dialog_jumpto.cpp index c52699917..7ab7c7d1c 100644 --- a/aegisub/dialog_jumpto.cpp +++ b/aegisub/dialog_jumpto.cpp @@ -69,11 +69,13 @@ DialogJumpTo::DialogJumpTo (wxWindow *parent) ready = false; jumpframe = VideoContext::Get()->GetFrameN(); jumptime.SetMS(VFR_Output.GetTimeAtFrame(jumpframe,true,true)); + wxString maxLength = wxString::Format(_T("%i"),VideoContext::Get()->GetLength()-1); // Times wxStaticText *LabelFrame = new wxStaticText(this,-1,_("Frame: "),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->SetMaxLength(maxLength.Len()); JumpTime = new TimeEdit(this,TEXT_JUMP_TIME,jumptime.GetASSFormated(),wxDefaultPosition,wxSize(60,20),wxTE_PROCESS_ENTER); wxSizer *FrameSizer = new wxBoxSizer(wxHORIZONTAL); wxSizer *TimeSizer = new wxBoxSizer(wxHORIZONTAL);