IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
#endif
+//pmg EVT_KILL_FOCUS
BEGIN_EVENT_TABLE(wxSpinCtrl, wxSpinButton)
EVT_CHAR(wxSpinCtrl::OnChar)
EVT_SET_FOCUS(wxSpinCtrl::OnSetFocus)
-
+ EVT_KILL_FOCUS(wxSpinCtrl::OnKillFocus)
EVT_SPIN(wxID_ANY, wxSpinCtrl::OnSpinChange)
END_EVENT_TABLE()
event.Skip();
}
+void wxSpinCtrl::OnKillFocus(wxFocusEvent& event)
+{
+ // ensure that the value is shown correctly
+ SetValue(GetValue()) ;
+ event.Skip();
+}
+
void wxSpinCtrl::OnSetFocus(wxFocusEvent& event)
{
// when we get focus, give it to our buddy window as it needs it more than