From a4dd4f69867a3ed0910996aa9297a6f545399bf4 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 26 Jun 2013 12:15:31 -0700 Subject: [PATCH] Send a fake focus lost event to wxSpinCtrlDouble before reading the value wxSpinCtrlDouble only updates its value when the spin button is clicked or it loses focus, and in some cases we want to read the value while it still has focus. Closes #1610. --- aegisub/src/auto4_lua_dialog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aegisub/src/auto4_lua_dialog.cpp b/aegisub/src/auto4_lua_dialog.cpp index bf988b95e..b073ff963 100644 --- a/aegisub/src/auto4_lua_dialog.cpp +++ b/aegisub/src/auto4_lua_dialog.cpp @@ -291,7 +291,10 @@ namespace Automation4 { } bool TransferFromWindow() { - *value = static_cast(GetWindow())->GetValue(); + auto ctrl = static_cast(GetWindow()); + wxFocusEvent evt; + ctrl->OnTextLostFocus(evt); + *value = ctrl->GetValue(); return true; } };