From 7bd3409f53598db894dbd17291b1819f8ef3800f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Sun, 18 May 2003 22:11:41 +0000 Subject: [PATCH] Recompute scrollbar positions in case window changed size svn path=/trunk/; revision=4723 --- reactos/subsys/win32k/ntuser/scrollbar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/reactos/subsys/win32k/ntuser/scrollbar.c b/reactos/subsys/win32k/ntuser/scrollbar.c index e0ed7018646..bfeef2bc824 100644 --- a/reactos/subsys/win32k/ntuser/scrollbar.c +++ b/reactos/subsys/win32k/ntuser/scrollbar.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: scrollbar.c,v 1.5 2003/05/18 17:16:17 ea Exp $ +/* $Id: scrollbar.c,v 1.6 2003/05/18 22:11:41 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -56,12 +56,9 @@ static BOOL STDCALL SCROLL_GetScrollBarRect (PWINDOW_OBJECT Window, INT nBar, PRECT lprect) { - SCROLLBARINFO info; - INT pixels, thumbSize, arrowSize; BOOL vertical; RECT ClientRect = Window->ClientRect; RECT WindowRect = Window->WindowRect; - ULONG Style; switch (nBar) { @@ -105,6 +102,7 @@ SCROLL_GetScrollBarRect (PWINDOW_OBJECT Window, INT nBar, PRECT lprect) return FALSE; } +#if 0 /* The code below computes all kind of stuff without using it */ if (vertical) pixels = lprect->bottom - lprect->top; else @@ -148,6 +146,7 @@ SCROLL_GetScrollBarRect (PWINDOW_OBJECT Window, INT nBar, PRECT lprect) + MulDiv(pixels, (info->CurVal-info->MinVal),(max - info->MinVal)); } */ } +#endif return vertical; } @@ -162,7 +161,8 @@ DWORD FASTCALL SCROLL_CreateScrollBar(PWINDOW_OBJECT Window, LONG idObject) &Window->WindowRect, &Window->ClientRect); - psbi = ExAllocatePool(NonPagedPool, sizeof(SCROLLBARINFO)); + psbi = ExAllocatePool(PagedPool, sizeof(SCROLLBARINFO)); + psbi->cbSize = sizeof(SCROLLBARINFO); for (i=0; irgstate[i] = 0; @@ -205,6 +205,8 @@ DWORD STDCALL SCROLL_GetScrollBarInfo(PWINDOW_OBJECT Window, LONG idObject, PSCR return FALSE; } + SCROLL_GetScrollBarRect (Window, idObject, &(psbi->rcScrollBar)); + return TRUE; }