From d9d0eddfde8b94cf7f73da200d1b861a5477471e Mon Sep 17 00:00:00 2001 From: Karl Blomster Date: Wed, 4 Feb 2009 01:45:43 +0000 Subject: [PATCH] Minor cosmetic fixes to the goto frame/time dialog box. Patch by Harukalover. Originally committed to SVN as r2720. --- aegisub/dialog_jumpto.cpp | 6 ++++-- aegisub/timeedit_ctrl.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/aegisub/dialog_jumpto.cpp b/aegisub/dialog_jumpto.cpp index 32777a90f..bf75a3aa5 100644 --- a/aegisub/dialog_jumpto.cpp +++ b/aegisub/dialog_jumpto.cpp @@ -68,7 +68,7 @@ DialogJumpTo::DialogJumpTo (wxWindow *parent) // Set initial values ready = false; jumpframe = VideoContext::Get()->GetFrameN(); - jumptime.SetMS(VFR_Output.GetTimeAtFrame(jumpframe)); + jumptime.SetMS(VFR_Output.GetTimeAtFrame(jumpframe,true,true)); // Times wxStaticText *LabelFrame = new wxStaticText(this,-1,_("Frame: "),wxDefaultPosition,wxSize(60,20)); @@ -147,6 +147,7 @@ void DialogJumpTo::OnEditTime (wxCommandEvent &event) { // Update frame long newframe = VFR_Output.GetFrameAtTime(JumpTime->time.GetMS()); + if (newframe > VideoContext::Get()->GetLength()-1) newframe = VideoContext::Get()->GetLength()-1; if (jumpframe != newframe) { jumpframe = newframe; JumpFrame->SetValue(wxString::Format(_T("%i"),jumpframe)); @@ -166,10 +167,11 @@ void DialogJumpTo::OnEditFrame (wxCommandEvent &event) { // Update frame JumpFrame->GetValue().ToLong(&jumpframe); + if (jumpframe > VideoContext::Get()->GetLength()-1) jumpframe = VideoContext::Get()->GetLength()-1; JumpFrame->SetValue(wxString::Format(_T("%i"),jumpframe)); // Update time - int newtime = VFR_Output.GetTimeAtFrame(jumpframe); + int newtime = VFR_Output.GetTimeAtFrame(jumpframe,true,true); if (jumptime.GetMS() != newtime) { jumptime.SetMS(newtime); JumpTime->SetValue(jumptime.GetASSFormated()); diff --git a/aegisub/timeedit_ctrl.cpp b/aegisub/timeedit_ctrl.cpp index 305fb0e1e..1e0d08fb1 100644 --- a/aegisub/timeedit_ctrl.cpp +++ b/aegisub/timeedit_ctrl.cpp @@ -71,7 +71,7 @@ wxTextCtrl(parent,id,value,pos,size,wxTE_CENTRE | style,validator,name) SetValidator(val); // Other stuff - SetValue(time.GetASSFormated()); + if (!value) SetValue(time.GetASSFormated()); ready = true; byFrame = false; isEnd = false;