corrected #ifdefs testing wxUSE_UNICODE_MSLU
[wxWidgets.git] / src / msw / spinctrl.cpp
index 02319d7e7bc947091aa0327fa7e65fca46d123db..93eeaf4a39565e1bf2496441817617d50c081065 100644 (file)
@@ -391,7 +391,7 @@ bool wxSpinCtrl::Create(wxWindow *parent,
     // associate the text window with the spin button
     (void)::SendMessage(GetHwnd(), UDM_SETBUDDY, (WPARAM)m_hwndBuddy, 0);
 
-    if ( !value.IsEmpty() )
+    if ( !value.empty() )
     {
         SetValue(value);
     }
@@ -435,7 +435,7 @@ int wxSpinCtrl::GetValue() const
     long n;
     if ( (wxSscanf(val, wxT("%lu"), &n) != 1) )
         n = INT_MIN;
-        
+
     if (n < m_min) n = m_min;
     if (n > m_max) n = m_max;
 
@@ -451,7 +451,7 @@ void wxSpinCtrl::SetSelection(long from, long to)
         from = 0;
     }
 
-    ::SendMessage((HWND)m_hwndBuddy, EM_SETSEL, (WPARAM)from, (LPARAM)to);
+    ::SendMessage(GetBuddyHwnd(), EM_SETSEL, (WPARAM)from, (LPARAM)to);
 }
 
 // ----------------------------------------------------------------------------
@@ -567,16 +567,12 @@ void wxSpinCtrl::DoMoveWindow(int x, int y, int width, int height)
         wxLogDebug(_T("not enough space for wxSpinCtrl!"));
     }
 
-    if ( !::MoveWindow(GetBuddyHwnd(), x, y, widthText, height, TRUE) )
-    {
-        wxLogLastError(wxT("MoveWindow(buddy)"));
-    }
+    // 1) The buddy window
+    DoMoveSibling(m_hwndBuddy, x, y, widthText, height);
 
+    // 2) The button window
     x += widthText + MARGIN_BETWEEN;
-    if ( !::MoveWindow(GetHwnd(), x, y, widthBtn, height, TRUE) )
-    {
-        wxLogLastError(wxT("MoveWindow"));
-    }
+    wxSpinButton::DoMoveWindow(x, y, widthBtn, height);
 }
 
 // get total size of the control