X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fe3d9123c6968b452a95133c635069d6f7ae8ea5..0b7824d78a475810924776e02004723cc4e20c84:/src/msw/scrolbar.cpp diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp index 63cc9f5d40..9f7c9ce146 100644 --- a/src/msw/scrolbar.cpp +++ b/src/msw/scrolbar.cpp @@ -53,6 +53,9 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, SetValidator(validator); #endif // wxUSE_VALIDATORS + if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT) + style |= wxNO_BORDER; + SetBackgroundColour(parent->GetBackgroundColour()) ; SetForegroundColour(parent->GetForegroundColour()) ; m_windowStyle = style; @@ -85,11 +88,6 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, WXDWORD exStyle = 0; WXDWORD wstyle = MSWGetStyle(style, & exStyle) ; -/* - if ( m_windowStyle & wxCLIP_SIBLINGS ) - wstyle |= WS_CLIPSIBLINGS; -*/ - // Now create scrollbar DWORD _direction = (style & wxHORIZONTAL) ? SBS_HORZ: SBS_VERT; @@ -129,10 +127,11 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, int position, maxPos, trackPos = pos; -#ifdef __WIN32__ // when we're dragging the scrollbar we can't use pos parameter because it // is limited to 16 bits - if ( wParam == SB_THUMBPOSITION || wParam == SB_THUMBTRACK ) + // JACS: now always using GetScrollInfo, since there's no reason + // not to +// if ( wParam == SB_THUMBPOSITION || wParam == SB_THUMBTRACK ) { SCROLLINFO scrollInfo; wxZeroMemory(scrollInfo); @@ -152,13 +151,14 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, position = scrollInfo.nPos; maxPos = scrollInfo.nMax; } +#if 0 else -#endif // Win32 { position = ::GetScrollPos((HWND) control, SB_CTL); int minPos; ::GetScrollRange((HWND) control, SB_CTL, &minPos, &maxPos); } +#endif #if defined(__WIN95__) // A page size greater than one has the effect of reducing the effective @@ -267,7 +267,17 @@ void wxScrollBar::SetThumbPosition(int viewStart) int wxScrollBar::GetThumbPosition(void) const { - return ::GetScrollPos((HWND)m_hWnd, SB_CTL); + SCROLLINFO scrollInfo; + wxZeroMemory(scrollInfo); + scrollInfo.cbSize = sizeof(SCROLLINFO); + scrollInfo.fMask = SIF_POS; + + if ( !::GetScrollInfo(GetHwnd(), SB_CTL, &scrollInfo) ) + { + wxLogLastError(_T("GetScrollInfo")); + } + return scrollInfo.nPos; +// return ::GetScrollPos((HWND)m_hWnd, SB_CTL); } void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageSize,