From 36ded6ef89af4e32c2b4112e4cf7a747be36900a Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 12 Dec 2010 00:34:02 +0000 Subject: [PATCH] Disable events while processing all file change events in SubsEditBox as apparently wxComboBox::Clear triggers change events on some platforms Originally committed to SVN as r4960. --- aegisub/src/subs_edit_box.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aegisub/src/subs_edit_box.cpp b/aegisub/src/subs_edit_box.cpp index 6adb7a142..86656b112 100644 --- a/aegisub/src/subs_edit_box.cpp +++ b/aegisub/src/subs_edit_box.cpp @@ -336,6 +336,7 @@ SubsEditBox::~SubsEditBox() { } void SubsEditBox::Update(int type) { + SetEvtHandlerEnabled(false); if (type == AssFile::COMMIT_FULL || type == AssFile::COMMIT_UNDO) { /// @todo maybe preserve selection over undo? StyleBox->Clear(); @@ -355,15 +356,16 @@ void SubsEditBox::Update(int type) { ActorBox->Thaw(); TextEdit->SetSelection(0,0); + SetEvtHandlerEnabled(true); return; } SetControlsState(!!line); if (!line) { + SetEvtHandlerEnabled(true); return; } - SetEvtHandlerEnabled(false); StartTime->SetTime(line->Start); EndTime->SetTime(line->End); Duration->SetTime(line->End-line->Start);