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 9969589cd6
commit 1adae3160c
1 changed files with 4 additions and 1 deletions

View File

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