]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/spinctrl.cpp
don't try to access empty wxIconBundle in gtk_frame_realized_callback
[wxWidgets.git] / src / msw / spinctrl.cpp
index 014e50d81cf576ba311072fbe332d26efef7a9d5..bf56006adeb9112e990655a779bf561d7215eba1 100644 (file)
@@ -87,7 +87,7 @@ wxEND_FLAGS( wxSpinCtrlStyle )
 IMPLEMENT_DYNAMIC_CLASS_XTI(wxSpinCtrl, wxControl,"wx/spinbut.h")
 
 wxBEGIN_PROPERTIES_TABLE(wxSpinCtrl)
-    wxEVENT_RANGE_PROPERTY( Spin , wxEVT_SCROLL_TOP , wxEVT_SCROLL_ENDSCROLL , wxSpinEvent )
+    wxEVENT_RANGE_PROPERTY( Spin , wxEVT_SCROLL_TOP , wxEVT_SCROLL_CHANGED , wxSpinEvent )
     wxEVENT_PROPERTY( Updated , wxEVT_COMMAND_SPINCTRL_UPDATED , wxCommandEvent )
     wxEVENT_PROPERTY( TextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent )
     wxEVENT_PROPERTY( TextEnter , wxEVT_COMMAND_TEXT_ENTER , wxCommandEvent )
@@ -409,6 +409,12 @@ bool wxSpinCtrl::Create(wxWindow *parent,
     if ( !value.empty() )
     {
         SetValue(value);
+        m_oldValue = (int) wxAtol(value);
+    }
+    else
+    {
+        SetValue(wxString::Format(wxT("%d"), initial));
+        m_oldValue = initial;
     }
 
     // do it after finishing with m_hwndBuddy creation to avoid generating