]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/spinctrl.cpp
Reset g_lastMouseEvent after processing the mouse button release event
[wxWidgets.git] / src / msw / spinctrl.cpp
index 6651f614ac4723cf4a4ba7d7802237e2f8126a30..f66f6bfbcf89e1863ebed71ce33cf95d73728a41 100644 (file)
@@ -372,8 +372,7 @@ bool wxSpinCtrl::Create(wxWindow *parent,
         return false;
     }
 
-    SetRange(min, max);
-    SetValue(initial);
+    wxSpinButtonBase::SetRange(min, max);
 
     m_oldValue = initial;
 
@@ -404,6 +403,14 @@ bool wxSpinCtrl::Create(wxWindow *parent,
     // associate the text window with the spin button
     (void)::SendMessage(GetHwnd(), UDM_SETBUDDY, (WPARAM)m_hwndBuddy, 0);
 
+    SetValue(initial);
+
+    // Set the range in the native control
+    SetRange(min, max);
+
+    // Send the initial event
+    SendSpinUpdate(initial);
+
     if ( !value.empty() )
     {
         SetValue(value);