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:
Thomas Goyne 2013-06-26 12:15:31 -07:00
parent 5199923a66
commit a4dd4f6986

View file

@ -291,7 +291,10 @@ namespace Automation4 {
} }
bool TransferFromWindow() { bool TransferFromWindow() {
*value = static_cast<wxSpinCtrlDouble*>(GetWindow())->GetValue(); auto ctrl = static_cast<wxSpinCtrlDouble*>(GetWindow());
wxFocusEvent evt;
ctrl->OnTextLostFocus(evt);
*value = ctrl->GetValue();
return true; return true;
} }
}; };