]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/spinctrl.cpp
fix for non precomp
[wxWidgets.git] / src / msw / spinctrl.cpp
index 93eeaf4a39565e1bf2496441817617d50c081065..dbc1bdd3ff8c9b95b66c475b2fb74950d35cbb85 100644 (file)
 // declarations
 // ============================================================================
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "spinctrlbase.h"
-    #pragma implementation "spinctrl.h"
-#endif
-
 // ----------------------------------------------------------------------------
 // headers
 // ----------------------------------------------------------------------------
@@ -114,11 +109,12 @@ wxCONSTRUCTOR_6( wxSpinCtrl , wxWindow* , Parent , wxWindowID , Id , wxString ,
 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()
 
@@ -267,6 +263,13 @@ void wxSpinCtrl::OnChar(wxKeyEvent& event)
     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