mirror of
https://github.com/reactos/reactos.git
synced 2025-07-23 08:14:16 +00:00
Draw minimize and maximize buttons with smaller, correct, metrics
svn path=/trunk/; revision=3572
This commit is contained in:
parent
bf59f99dac
commit
d166ac40b1
2 changed files with 14 additions and 11 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: defwnd.c,v 1.12 2002/09/25 21:21:36 dwelch Exp $
|
/* $Id: defwnd.c,v 1.13 2002/09/28 22:13:28 jfilby Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
|
@ -240,8 +240,8 @@ static void UserDrawMaxButton( HWND hwnd, HDC hdc, BOOL down )
|
||||||
SelectObject( hdcMem, (IsZoomed(hwnd)
|
SelectObject( hdcMem, (IsZoomed(hwnd)
|
||||||
? (down ? hbitmapRestoreD : hbitmapRestore)
|
? (down ? hbitmapRestoreD : hbitmapRestore)
|
||||||
: (down ? hbitmapMaximizeD : hbitmapMaximize)) );
|
: (down ? hbitmapMaximizeD : hbitmapMaximize)) );
|
||||||
BitBlt( hdc, rect.right - GetSystemMetrics(SM_CXSIZE) - 1, rect.top,
|
BitBlt( hdc, rect.right - GetSystemMetrics(SM_CXSMSIZE) - 1, rect.top,
|
||||||
GetSystemMetrics(SM_CXSIZE) + 1, GetSystemMetrics(SM_CYSIZE), hdcMem, 0, 0,
|
GetSystemMetrics(SM_CXSMSIZE) + 1, GetSystemMetrics(SM_CYSMSIZE), hdcMem, 0, 0,
|
||||||
SRCCOPY );
|
SRCCOPY );
|
||||||
DeleteDC( hdcMem );
|
DeleteDC( hdcMem );
|
||||||
}
|
}
|
||||||
|
@ -256,10 +256,10 @@ static void UserDrawMinButton( HWND hwnd, HDC hdc, BOOL down)
|
||||||
SelectObject(hdcMem, (down ? hbitmapMinimizeD : hbitmapMinimize));
|
SelectObject(hdcMem, (down ? hbitmapMinimizeD : hbitmapMinimize));
|
||||||
if (GetWindowLong(hwnd, GWL_STYLE) & WS_MAXIMIZEBOX)
|
if (GetWindowLong(hwnd, GWL_STYLE) & WS_MAXIMIZEBOX)
|
||||||
{
|
{
|
||||||
rect.right -= GetSystemMetrics(SM_CXSIZE)+1;
|
rect.right -= GetSystemMetrics(SM_CXSMSIZE)+1;
|
||||||
}
|
}
|
||||||
BitBlt( hdc, rect.right - GetSystemMetrics(SM_CXSIZE) - 1, rect.top,
|
BitBlt( hdc, rect.right - GetSystemMetrics(SM_CXSMSIZE) - 1, rect.top,
|
||||||
GetSystemMetrics(SM_CXSIZE) + 1, GetSystemMetrics(SM_CYSIZE),
|
GetSystemMetrics(SM_CXSMSIZE) + 1, GetSystemMetrics(SM_CYSMSIZE),
|
||||||
hdcMem, 0, 0,
|
hdcMem, 0, 0,
|
||||||
SRCCOPY );
|
SRCCOPY );
|
||||||
DeleteDC( hdcMem );
|
DeleteDC( hdcMem );
|
||||||
|
@ -306,12 +306,12 @@ static void UserDrawCaptionNC( HDC hdc, RECT *rect, HWND hwnd,
|
||||||
if (style & WS_MAXIMIZEBOX)
|
if (style & WS_MAXIMIZEBOX)
|
||||||
{
|
{
|
||||||
UserDrawMaxButton( hwnd, hdc, FALSE );
|
UserDrawMaxButton( hwnd, hdc, FALSE );
|
||||||
r.right -= GetSystemMetrics(SM_CXSIZE) + 1;
|
r.right -= GetSystemMetrics(SM_CXSMSIZE) + 1;
|
||||||
}
|
}
|
||||||
if (style & WS_MINIMIZEBOX)
|
if (style & WS_MINIMIZEBOX)
|
||||||
{
|
{
|
||||||
UserDrawMinButton( hwnd, hdc, FALSE );
|
UserDrawMinButton( hwnd, hdc, FALSE );
|
||||||
r.right -= GetSystemMetrics(SM_CXSIZE) + 1;
|
r.right -= GetSystemMetrics(SM_CXSMSIZE) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
FillRect( hdc, &r, GetSysColorBrush(active ? COLOR_ACTIVECAPTION :
|
FillRect( hdc, &r, GetSysColorBrush(active ? COLOR_ACTIVECAPTION :
|
||||||
|
@ -598,7 +598,7 @@ DefWndHitTestNC(HWND hWnd, POINT Point)
|
||||||
|
|
||||||
if (Style & WS_MAXIMIZEBOX)
|
if (Style & WS_MAXIMIZEBOX)
|
||||||
{
|
{
|
||||||
WindowRect.right -= GetSystemMetrics(SM_CXSIZE) + 1;
|
WindowRect.right -= GetSystemMetrics(SM_CXSMSIZE) + 1;
|
||||||
}
|
}
|
||||||
if (Point.x >= WindowRect.right)
|
if (Point.x >= WindowRect.right)
|
||||||
{
|
{
|
||||||
|
@ -607,7 +607,7 @@ DefWndHitTestNC(HWND hWnd, POINT Point)
|
||||||
|
|
||||||
if (Style & WS_MINIMIZEBOX)
|
if (Style & WS_MINIMIZEBOX)
|
||||||
{
|
{
|
||||||
WindowRect.right -= GetSystemMetrics(SM_CXSIZE) + 1;
|
WindowRect.right -= GetSystemMetrics(SM_CXSMSIZE) + 1;
|
||||||
}
|
}
|
||||||
if (Point.x >= WindowRect.right)
|
if (Point.x >= WindowRect.right)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: metric.c,v 1.4 2002/09/03 22:44:21 dwelch Exp $
|
/* $Id: metric.c,v 1.5 2002/09/28 22:13:28 jfilby Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -58,6 +58,9 @@ NtUserGetSystemMetrics(ULONG Index)
|
||||||
case SM_CXSIZE:
|
case SM_CXSIZE:
|
||||||
case SM_CYSIZE:
|
case SM_CYSIZE:
|
||||||
return(18);
|
return(18);
|
||||||
|
case SM_CXSMSIZE:
|
||||||
|
case SM_CYSMSIZE:
|
||||||
|
return(14);
|
||||||
default:
|
default:
|
||||||
return(0xFFFFFFFF);
|
return(0xFFFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue