From 14b425d0a34a65ec151e17b15bf049e62c4695cc Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Thu, 26 Jul 2007 22:47:49 +0000 Subject: [PATCH] Fixed issue with time edit boxes being unable to represent times over 1 hour in certain cases - #482 Originally committed to SVN as r1439. --- aegisub/timeedit_ctrl.cpp | 10 +++++----- aegisub/timeedit_ctrl.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/aegisub/timeedit_ctrl.cpp b/aegisub/timeedit_ctrl.cpp index 3d5f6ee30..5321b0e45 100644 --- a/aegisub/timeedit_ctrl.cpp +++ b/aegisub/timeedit_ctrl.cpp @@ -100,14 +100,14 @@ void TimeEdit::OnModified(wxCommandEvent &event) { ///////////////////// // Modified function -void TimeEdit::Modified() { +void TimeEdit::Modified(bool byUser) { // Lock if (!ready) return; ready = false; // Update if (byFrame) Update(); - else UpdateTime(); + else UpdateTime(byUser); // Colour if (showModified && !modified) { @@ -126,7 +126,7 @@ void TimeEdit::SetTime(int ms,bool setModified) { int oldMs = time.GetMS(); time.SetMS(ms); UpdateText(); - if (setModified && oldMs != ms) Modified(); + if (setModified && oldMs != ms) Modified(false); } @@ -191,11 +191,11 @@ void TimeEdit::Update() { ///////////////////////////////////////////////// // Reads value from a text control and update it -void TimeEdit::UpdateTime() { +void TimeEdit::UpdateTime(bool byUser) { bool insertion = Options.AsBool(_T("Insert Mode on Time Boxes")); wxString text = GetValue(); long start=0,end=0; - if (insertion) { + if (insertion && byUser) { GetSelection(&start,&end); if (start == end) { wxString nextChar = text.Mid(start,1); diff --git a/aegisub/timeedit_ctrl.h b/aegisub/timeedit_ctrl.h index 6777f3cbb..e32352fd7 100644 --- a/aegisub/timeedit_ctrl.h +++ b/aegisub/timeedit_ctrl.h @@ -51,11 +51,11 @@ private: bool ready; bool modified; - void Modified(); + void Modified(bool byUser=true); void UpdateText(); void CopyTime(); void PasteTime(); - void UpdateTime(); + void UpdateTime(bool byUser=true); void OnModified(wxCommandEvent &event); void OnMouseEvent(wxMouseEvent &event);