More scrolling stuff.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10165 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2001-05-15 19:52:31 +00:00
parent 23ca6e208f
commit e661fcd770

View File

@@ -728,7 +728,7 @@ void wxWindow::SetScrollbar(
int nPageSize = nThumbVisible; int nPageSize = nThumbVisible;
SBCDATA vInfo; SBCDATA vInfo;
HWND hWnd = GetHwnd(); HWND hWnd = GetHwnd();
ULONG ulStyle = WS_VISIBLE; ULONG ulStyle = WS_VISIBLE | WS_SYNCPAINT;
RECTL vRect; RECTL vRect;
::WinQueryWindowRect(hWnd, &vRect); ::WinQueryWindowRect(hWnd, &vRect);
@@ -752,7 +752,7 @@ void wxWindow::SetScrollbar(
// registered as child windows of the window in order that child // registered as child windows of the window in order that child
// windows may be scrolled without scrolling the scrollbars themselves! // windows may be scrolled without scrolling the scrollbars themselves!
// //
m_hWndScrollBarHorz = ::WinCreateWindow( HWND_DESKTOP m_hWndScrollBarHorz = ::WinCreateWindow( hWnd
,WC_SCROLLBAR ,WC_SCROLLBAR
,(PSZ)NULL ,(PSZ)NULL
,ulStyle ,ulStyle
@@ -802,7 +802,7 @@ void wxWindow::SetScrollbar(
ulStyle |= SBS_VERT; ulStyle |= SBS_VERT;
if (m_hWndScrollBarVert == 0L) if (m_hWndScrollBarVert == 0L)
{ {
m_hWndScrollBarVert = ::WinCreateWindow( HWND_DESKTOP m_hWndScrollBarVert = ::WinCreateWindow( hWnd
,WC_SCROLLBAR ,WC_SCROLLBAR
,(PSZ)NULL ,(PSZ)NULL
,ulStyle ,ulStyle
@@ -867,7 +867,15 @@ void wxWindow::ScrollWindow(
vRect2.xRight = pRect->x + pRect->width; vRect2.xRight = pRect->x + pRect->width;
vRect2.yBottom = pRect->y; vRect2.yBottom = pRect->y;
} }
else
{
::WinQueryWindowRect(GetHwnd(), &vRect2);
::WinQueryWindowRect(m_hWndScrollBarHorz, &vRect);
vRect2.yBottom += vRect.yTop - vRect.yBottom;
::WinQueryWindowRect(m_hWndScrollBarVert, &vRect);
vRect2.xRight -= vRect.xRight - vRect.xLeft;
}
if (pRect) if (pRect)
::WinScrollWindow( GetHwnd() ::WinScrollWindow( GetHwnd()
,(LONG)nDx ,(LONG)nDx
@@ -876,7 +884,7 @@ void wxWindow::ScrollWindow(
,NULL ,NULL
,NULLHANDLE ,NULLHANDLE
,NULL ,NULL
,SW_SCROLLCHILDREN | SW_INVALIDATERGN ,SW_INVALIDATERGN
); );
else else
::WinScrollWindow( GetHwnd() ::WinScrollWindow( GetHwnd()
@@ -886,8 +894,29 @@ void wxWindow::ScrollWindow(
,NULL ,NULL
,NULLHANDLE ,NULLHANDLE
,NULL ,NULL
,SW_SCROLLCHILDREN | SW_INVALIDATERGN ,SW_INVALIDATERGN
); );
//
// Move the children
wxWindowList::Node* pCurrent = GetChildren().GetFirst();
SWP vSwp;
while (pCurrent)
{
wxWindow* pChildWin = pCurrent->GetData();
::WinQueryWindowPos(pChildWin->GetHWND(), &vSwp);
::WinSetWindowPos( pChildWin->GetHWND()
,HWND_TOP
,vSwp.x + nDx
,vSwp.y + nDy
,0
,0
, SWP_MOVE | SWP_SHOW
);
pCurrent = pCurrent->GetNext();
}
} // end of wxWindow::ScrollWindow } // end of wxWindow::ScrollWindow
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------