X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/74124ea96161da28a76df576e410c3437ac58272..4a10ea8b13fd0851e71e6fa5ebbe5b93933be11e:/src/msw/spinctrl.cpp diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 02319d7e7b..8beb9485ca 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -13,11 +13,6 @@ // declarations // ============================================================================ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "spinctrlbase.h" - #pragma implementation "spinctrl.h" -#endif - // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- @@ -391,7 +386,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 +430,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 +446,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 +562,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