forked from mia/Aegisub
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.
This commit is contained in:
parent
5199923a66
commit
a4dd4f6986
1 changed files with 4 additions and 1 deletions
|
@ -291,7 +291,10 @@ namespace Automation4 {
|
|||
}
|
||||
|
||||
bool TransferFromWindow() {
|
||||
*value = static_cast<wxSpinCtrlDouble*>(GetWindow())->GetValue();
|
||||
auto ctrl = static_cast<wxSpinCtrlDouble*>(GetWindow());
|
||||
wxFocusEvent evt;
|
||||
ctrl->OnTextLostFocus(evt);
|
||||
*value = ctrl->GetValue();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue