Commit bfd02281 authored by Noomen Hamza's avatar Noomen Hamza Committed by Alexandre Julliard

Fixed the NC_DrawMaxButton95 and NC_DrawMinButton95 functions. Rewrote

these functions with the same logic as the NC_DrawCloseButton function.
parent 463eb294
...@@ -1050,8 +1050,7 @@ NC_DrawSysButton95 (HWND32 hwnd, HDC32 hdc, BOOL32 down) ...@@ -1050,8 +1050,7 @@ NC_DrawSysButton95 (HWND32 hwnd, HDC32 hdc, BOOL32 down)
* *
*****************************************************************************/ *****************************************************************************/
void void NC_DrawCloseButton95 (HWND32 hwnd, HDC32 hdc, BOOL32 down)
NC_DrawCloseButton95 (HWND32 hwnd, HDC32 hdc, BOOL32 down)
{ {
RECT32 rect; RECT32 rect;
HDC32 hdcMem; HDC32 hdcMem;
...@@ -1065,7 +1064,7 @@ NC_DrawCloseButton95 (HWND32 hwnd, HDC32 hdc, BOOL32 down) ...@@ -1065,7 +1064,7 @@ NC_DrawCloseButton95 (HWND32 hwnd, HDC32 hdc, BOOL32 down)
NC_GetInsideRect95( hwnd, &rect ); NC_GetInsideRect95( hwnd, &rect );
hdcMem = CreateCompatibleDC32( hdc ); hdcMem = CreateCompatibleDC32( hdc );
hBmp = /*down ? hbitmapCloseD :*/ hbitmapClose; hBmp = down ? hbitmapCloseD : hbitmapClose;
hOldBmp = SelectObject32 (hdcMem, hBmp); hOldBmp = SelectObject32 (hdcMem, hBmp);
GetObject32A (hBmp, sizeof(BITMAP32), &bmp); GetObject32A (hBmp, sizeof(BITMAP32), &bmp);
BitBlt32 (hdc, rect.right - (sysMetrics[SM_CYCAPTION] + 1 + bmp.bmWidth) / 2, BitBlt32 (hdc, rect.right - (sysMetrics[SM_CYCAPTION] + 1 + bmp.bmWidth) / 2,
...@@ -1077,7 +1076,6 @@ NC_DrawCloseButton95 (HWND32 hwnd, HDC32 hdc, BOOL32 down) ...@@ -1077,7 +1076,6 @@ NC_DrawCloseButton95 (HWND32 hwnd, HDC32 hdc, BOOL32 down)
} }
} }
/****************************************************************************** /******************************************************************************
* *
* NC_DrawMaxButton95( * NC_DrawMaxButton95(
...@@ -1098,40 +1096,36 @@ NC_DrawCloseButton95 (HWND32 hwnd, HDC32 hdc, BOOL32 down) ...@@ -1098,40 +1096,36 @@ NC_DrawCloseButton95 (HWND32 hwnd, HDC32 hdc, BOOL32 down)
* *
*****************************************************************************/ *****************************************************************************/
static void NC_DrawMaxButton95( static void NC_DrawMaxButton95(HWND32 hwnd,HDC16 hdc,BOOL32 down )
HWND32 hwnd,
HDC16 hdc,
BOOL32 down )
{ {
RECT32 rect; RECT32 rect;
WND *wndPtr = WIN_FindWndPtr( hwnd );
SIZE32 bmsz;
HBITMAP32 bm;
HDC32 hdcMem; HDC32 hdcMem;
WND *wndPtr = WIN_FindWndPtr( hwnd );
if( !(wndPtr->flags & WIN_MANAGED) && if( !(wndPtr->flags & WIN_MANAGED))
GetBitmapDimensionEx32((bm = IsZoomed32(hwnd) ? {
(down ? hbitmapRestoreD : hbitmapRestore ) : BITMAP32 bmp;
(down ? hbitmapMaximizeD : hbitmapMaximize)), HBITMAP32 hBmp,hOldBmp;
&bmsz)) {
NC_GetInsideRect95( hwnd, &rect ); NC_GetInsideRect95( hwnd, &rect );
hdcMem = CreateCompatibleDC32( hdc );
hBmp = IsZoomed32(hwnd) ?
(down ? hbitmapRestoreD : hbitmapRestore ) :
(down ? hbitmapMaximizeD: hbitmapMaximize);
hOldBmp=SelectObject32( hdcMem, hBmp );
GetObject32A (hBmp, sizeof(BITMAP32), &bmp);
if (wndPtr->dwStyle & WS_SYSMENU) if (wndPtr->dwStyle & WS_SYSMENU)
rect.right -= sysMetrics[SM_CYCAPTION] + 1; rect.right -= sysMetrics[SM_CYCAPTION] + 1;
hdcMem = CreateCompatibleDC32( hdc ); BitBlt32( hdc, rect.right - (sysMetrics[SM_CXSIZE] + bmp.bmWidth) / 2,
SelectObject32( hdc, bm ); rect.top + (sysMetrics[SM_CYCAPTION] - 1 - bmp.bmHeight) / 2,
BitBlt32( hdc, rect.right - (sysMetrics[SM_CXSIZE] + bmsz.cx) / 2, bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY );
rect.top + (sysMetrics[SM_CYCAPTION] - 1 - bmsz.cy) / 2, SelectObject32 (hdcMem, hOldBmp);
bmsz.cx, bmsz.cy, hdcMem, 0, 0, SRCCOPY );
DeleteDC32( hdcMem ); DeleteDC32( hdcMem );
} }
return;
} }
/****************************************************************************** /******************************************************************************
* *
* NC_DrawMinButton95( * NC_DrawMinButton95(
...@@ -1151,42 +1145,40 @@ static void NC_DrawMaxButton95( ...@@ -1151,42 +1145,40 @@ static void NC_DrawMaxButton95(
* *
*****************************************************************************/ *****************************************************************************/
static void NC_DrawMinButton95( static void NC_DrawMinButton95(HWND32 hwnd,HDC16 hdc,BOOL32 down )
HWND32 hwnd,
HDC16 hdc,
BOOL32 down )
{ {
RECT32 rect; RECT32 rect;
WND *wndPtr = WIN_FindWndPtr( hwnd );
SIZE32 bmsz;
HBITMAP32 bm;
HDC32 hdcMem; HDC32 hdcMem;
WND *wndPtr = WIN_FindWndPtr( hwnd );
if( !(wndPtr->flags & WIN_MANAGED) && if( !(wndPtr->flags & WIN_MANAGED))
GetBitmapDimensionEx32((bm = down ? hbitmapMinimizeD :
hbitmapMinimize), &bmsz)) { {
BITMAP32 bmp;
HBITMAP32 hBmp,hOldBmp;
NC_GetInsideRect95( hwnd, &rect ); NC_GetInsideRect95( hwnd, &rect );
hdcMem = CreateCompatibleDC32( hdc );
hBmp = down ? hbitmapMinimizeD : hbitmapMinimize;
hOldBmp= SelectObject32( hdcMem, hBmp );
GetObject32A (hBmp, sizeof(BITMAP32), &bmp);
if (wndPtr->dwStyle & WS_SYSMENU) if (wndPtr->dwStyle & WS_SYSMENU)
rect.right -= sysMetrics[SM_CYCAPTION] + 1; rect.right -= sysMetrics[SM_CYCAPTION] + 1;
if (wndPtr->dwStyle & WS_MAXIMIZEBOX) if (wndPtr->dwStyle & WS_MAXIMIZEBOX)
rect.right += -1 - rect.right += -1 - (sysMetrics[SM_CXSIZE] + bmp.bmWidth) / 2;
(sysMetrics[SM_CXSIZE] + bmsz.cx) / 2;
hdcMem = CreateCompatibleDC32( hdc ); BitBlt32( hdc, rect.right - (sysMetrics[SM_CXSIZE] + bmp.bmWidth) / 2,
SelectObject32( hdc, bm ); rect.top + (sysMetrics[SM_CYCAPTION] - 1 - bmp.bmHeight) / 2,
BitBlt32( hdc, rect.right - (sysMetrics[SM_CXSIZE] + bmsz.cx) / 2, bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY );
rect.top + (sysMetrics[SM_CYCAPTION] - 1 - bmsz.cy) / 2,
bmsz.cx, bmsz.cy, hdcMem, 0, 0, SRCCOPY ); SelectObject32 (hdcMem, hOldBmp);
DeleteDC32( hdcMem ); DeleteDC32( hdcMem );
} }
return;
} }
/*********************************************************************** /***********************************************************************
* NC_DrawFrame * NC_DrawFrame
* *
...@@ -1331,8 +1323,6 @@ static void NC_DrawFrame95( ...@@ -1331,8 +1323,6 @@ static void NC_DrawFrame95(
InflateRect32( rect, -width, -height ); InflateRect32( rect, -width, -height );
} }
/*********************************************************************** /***********************************************************************
* NC_DrawMovingFrame * NC_DrawMovingFrame
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment