fixed some drawing bugs of scrollbars

svn path=/trunk/; revision=6143
This commit is contained in:
Thomas Bluemel 2003-09-25 21:16:56 +00:00
parent 895c98c856
commit fbbaa9a97d

View file

@ -1,4 +1,4 @@
/* $Id: scrollbar.c,v 1.17 2003/09/24 13:41:40 weiden Exp $ /* $Id: scrollbar.c,v 1.18 2003/09/25 21:16:56 weiden Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -141,43 +141,73 @@ DbgPrint("[SCROLL_DrawInterior:%d]\n", nBar);
psbi->xyThumbTop -= arrowSize; psbi->xyThumbTop -= arrowSize;
if (vertical) if(psbi->dxyLineButton)
{ {
PatBlt (hdc, if (vertical)
rc.left, {
rc.top, if(thumbSize)
rc.right - rc.left, {
psbi->dxyLineButton, PatBlt (hdc,
top_selected ? 0x0f0000 : PATCOPY); rc.left,
rc.top += psbi->xyThumbTop; rc.top,
PatBlt (hdc, rc.right - rc.left,
rc.left, psbi->xyThumbTop,
rc.top + thumbSize, top_selected ? 0x0f0000 : PATCOPY);
rc.right - rc.left, rc.top += psbi->xyThumbTop;
rc.bottom - rc.top - thumbSize, PatBlt (hdc,
bottom_selected ? 0x0f0000 : PATCOPY); rc.left,
rc.bottom = rc.top + thumbSize; rc.top + thumbSize,
} rc.right - rc.left,
else rc.bottom - rc.top - thumbSize,
{ bottom_selected ? 0x0f0000 : PATCOPY);
PatBlt (hdc, rc.bottom = rc.top + thumbSize;
rc.left, }
rc.top, else
psbi->xyThumbTop, {
rc.bottom - rc.top, if(psbi->xyThumbTop)
top_selected ? 0x0f0000 : PATCOPY); PatBlt (hdc,
rc.left += psbi->xyThumbTop; rc.left,
PatBlt (hdc, psbi->dxyLineButton,
rc.left + thumbSize, rc.right - rc.left,
rc.top, rc.bottom - rc.bottom,
rc.right - rc.left - thumbSize, PATCOPY);
rc.bottom - rc.top, }
bottom_selected ? 0x0f0000 : PATCOPY); }
rc.right = rc.left + thumbSize; else
{
if(thumbSize)
{
PatBlt (hdc,
rc.left,
rc.top,
psbi->xyThumbTop,
rc.bottom - rc.top,
top_selected ? 0x0f0000 : PATCOPY);
rc.left += psbi->xyThumbTop;
PatBlt (hdc,
rc.left + thumbSize,
rc.top,
rc.right - rc.left - thumbSize,
rc.bottom - rc.top,
bottom_selected ? 0x0f0000 : PATCOPY);
rc.right = rc.left + thumbSize;
}
else
{
if(psbi->xyThumbTop)
PatBlt (hdc,
psbi->dxyLineButton,
rc.top,
rc.right - rc.left,
rc.bottom - rc.top,
PATCOPY);
}
}
} }
/* Draw the thumb */ /* Draw the thumb */
DrawEdge (hdc, &rc, EDGE_RAISED, BF_RECT | BF_MIDDLE); if(thumbSize)
DrawEdge (hdc, &rc, EDGE_RAISED, BF_RECT | BF_MIDDLE);
/* cleanup */ /* cleanup */
SelectObject (hdc, hSavePen); SelectObject (hdc, hSavePen);
@ -281,10 +311,7 @@ SCROLL_DrawScrollBar (HWND hwnd, HDC hdc, INT nBar,
thumbSize = info.xyThumbBottom - info.xyThumbTop; thumbSize = info.xyThumbBottom - info.xyThumbTop;
if (vertical) arrowSize = info.dxyLineButton;
arrowSize = GetSystemMetrics(SM_CXVSCROLL);
else
arrowSize = GetSystemMetrics(SM_CYHSCROLL);
if (IsRectEmpty (&(info.rcScrollBar))) goto END; if (IsRectEmpty (&(info.rcScrollBar))) goto END;