Commit cc2d3826 authored by Alexandre Julliard's avatar Alexandre Julliard

Use DrawFrameControl instead of bitmaps in certain cases.

Moved remaining OEM bitmaps to user32 resources.
parent 6ea7932c
...@@ -146,15 +146,7 @@ typedef struct ...@@ -146,15 +146,7 @@ typedef struct
static WORD arrow_bitmap_width = 0, arrow_bitmap_height = 0; static WORD arrow_bitmap_width = 0, arrow_bitmap_height = 0;
static HBITMAP hStdMnArrow = 0; static HBITMAP hStdMnArrow = 0;
static HBITMAP hBmpSysMenu = 0;
/* Minimze/restore/close buttons to be inserted in menubar */
static HBITMAP hBmpMinimize = 0;
static HBITMAP hBmpMinimizeD = 0;
static HBITMAP hBmpMaximize = 0;
static HBITMAP hBmpMaximizeD = 0;
static HBITMAP hBmpClose = 0;
static HBITMAP hBmpCloseD = 0;
static HBRUSH hShadeBrush = 0; static HBRUSH hShadeBrush = 0;
static HFONT hMenuFont = 0; static HFONT hMenuFont = 0;
...@@ -397,12 +389,7 @@ BOOL MENU_Init() ...@@ -397,12 +389,7 @@ BOOL MENU_Init()
/* Load menu bitmaps */ /* Load menu bitmaps */
hStdMnArrow = LoadBitmapA(0, MAKEINTRESOURCEA(OBM_MNARROW)); hStdMnArrow = LoadBitmapA(0, MAKEINTRESOURCEA(OBM_MNARROW));
/* Load system buttons bitmaps */ /* Load system buttons bitmaps */
hBmpMinimize = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_REDUCE)); hBmpSysMenu = LoadBitmapA(0, MAKEINTRESOURCEA(OBM_CLOSE));
hBmpMinimizeD = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_REDUCED));
hBmpMaximize = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_RESTORE));
hBmpMaximizeD = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_RESTORED));
hBmpClose = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_CLOSE));
hBmpCloseD = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_CLOSED));
if (hStdMnArrow) if (hStdMnArrow)
{ {
...@@ -696,47 +683,150 @@ static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu, ...@@ -696,47 +683,150 @@ static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu,
} }
return (UINT)(-1); return (UINT)(-1);
} }
/*********************************************************************** /***********************************************************************
* MENU_LoadMagicItem * MENU_GetBitmapItemSize
* *
* Load the bitmap associated with the magic menu item and its style * Get the size of a bitmap item.
*/ */
static void MENU_GetBitmapItemSize( UINT id, DWORD data, SIZE *size )
static HBITMAP MENU_LoadMagicItem(UINT id, BOOL hilite, DWORD dwItemData)
{ {
/* BITMAP bm;
* Magic menu item id's section HBITMAP bmp = (HBITMAP)id;
* These magic id's are used by windows to insert "standard" mdi
* buttons (minimize,restore,close) on menu. Under windows, size->cx = size->cy = 0;
* these magic id's make sure the right things appear when those
* bitmap buttons are pressed/selected/released. /* check if there is a magic menu item associated with this item */
*/ if (id && IS_MAGIC_ITEM( id ))
{
switch(id & 0xffff) switch(LOWORD(id))
{ case HBMMENU_SYSTEM: {
return (dwItemData) ? case HBMMENU_SYSTEM:
(HBITMAP)dwItemData : if (data)
(hilite ? hBmpMinimizeD : hBmpMinimize); {
bmp = (HBITMAP)data;
break;
}
/* fall through */
case HBMMENU_MBAR_RESTORE: case HBMMENU_MBAR_RESTORE:
return (hilite ? hBmpMaximizeD: hBmpMaximize);
case HBMMENU_MBAR_MINIMIZE: case HBMMENU_MBAR_MINIMIZE:
return (hilite ? hBmpMinimizeD : hBmpMinimize); case HBMMENU_MBAR_MINIMIZE_D:
case HBMMENU_MBAR_CLOSE: case HBMMENU_MBAR_CLOSE:
return (hilite ? hBmpCloseD : hBmpClose);
case HBMMENU_CALLBACK:
case HBMMENU_MBAR_CLOSE_D: case HBMMENU_MBAR_CLOSE_D:
case HBMMENU_MBAR_MINIMIZE_D: size->cx = GetSystemMetrics( SM_CXSIZE );
size->cy = GetSystemMetrics( SM_CYSIZE );
return;
case HBMMENU_CALLBACK:
case HBMMENU_POPUP_CLOSE: case HBMMENU_POPUP_CLOSE:
case HBMMENU_POPUP_RESTORE: case HBMMENU_POPUP_RESTORE:
case HBMMENU_POPUP_MAXIMIZE: case HBMMENU_POPUP_MAXIMIZE:
case HBMMENU_POPUP_MINIMIZE: case HBMMENU_POPUP_MINIMIZE:
default: default:
FIXME("Magic 0x%08x not implemented\n", id); FIXME("Magic 0x%08x not implemented\n", id);
return 0; return;
} }
}
if (GetObjectA(bmp, sizeof(bm), &bm ))
{
size->cx = bm.bmWidth;
size->cy = bm.bmHeight;
}
}
/***********************************************************************
* MENU_DrawBitmapItem
*
* Draw a bitmap item.
*/
static void MENU_DrawBitmapItem( HDC hdc, MENUITEM *lpitem, const RECT *rect, BOOL menuBar )
{
BITMAP bm;
DWORD rop;
HDC hdcMem;
HBITMAP bmp = (HBITMAP)lpitem->text;
int w = rect->right - rect->left;
int h = rect->bottom - rect->top;
int bmp_xoffset = 0;
int left, top;
/* Check if there is a magic menu item associated with this item */
if (lpitem->text && IS_MAGIC_ITEM(lpitem->text))
{
UINT flags = 0;
RECT r;
switch(LOWORD(lpitem->text))
{
case HBMMENU_SYSTEM:
if (lpitem->dwItemData)
{
bmp = (HBITMAP)lpitem->dwItemData;
if (!GetObjectA( bmp, sizeof(bm), &bm )) return;
}
else
{
bmp = hBmpSysMenu;
if (!GetObjectA( bmp, sizeof(bm), &bm )) return;
/* only use right half of the bitmap */
bmp_xoffset = bm.bmWidth / 2;
bm.bmWidth -= bmp_xoffset;
}
goto got_bitmap;
case HBMMENU_MBAR_RESTORE:
flags = DFCS_CAPTIONRESTORE;
break;
case HBMMENU_MBAR_MINIMIZE:
flags = DFCS_CAPTIONMIN;
break;
case HBMMENU_MBAR_MINIMIZE_D:
flags = DFCS_CAPTIONMIN | DFCS_INACTIVE;
break;
case HBMMENU_MBAR_CLOSE:
flags = DFCS_CAPTIONCLOSE;
break;
case HBMMENU_MBAR_CLOSE_D:
flags = DFCS_CAPTIONCLOSE | DFCS_INACTIVE;
break;
case HBMMENU_CALLBACK:
case HBMMENU_POPUP_CLOSE:
case HBMMENU_POPUP_RESTORE:
case HBMMENU_POPUP_MAXIMIZE:
case HBMMENU_POPUP_MINIMIZE:
default:
FIXME("Magic 0x%08x not implemented\n", LOWORD(lpitem->text));
return;
}
r = *rect;
InflateRect( &r, -1, -1 );
if (lpitem->fState & MF_HILITE) flags |= DFCS_PUSHED;
DrawFrameControl( hdc, &r, DFC_CAPTION, flags );
return;
}
if (!bmp || !GetObjectA( bmp, sizeof(bm), &bm )) return;
got_bitmap:
hdcMem = CreateCompatibleDC( hdc );
SelectObject( hdcMem, bmp );
/* handle fontsize > bitmap_height */
top = (h>bm.bmHeight) ? rect->top+(h-bm.bmHeight)/2 : rect->top;
left=rect->left;
if (TWEAK_WineLook == WIN95_LOOK) {
rop=((lpitem->fState & MF_HILITE) && !IS_MAGIC_ITEM(lpitem->text)) ? NOTSRCCOPY : SRCCOPY;
if ((lpitem->fState & MF_HILITE) && IS_BITMAP_ITEM(lpitem->fType))
SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));
} else {
left++;
w-=2;
rop=((lpitem->fState & MF_HILITE) && !IS_MAGIC_ITEM(lpitem->text) && (!menuBar)) ? MERGEPAINT : SRCCOPY;
}
BitBlt( hdc, left, top, w, h, hdcMem, bmp_xoffset, 0, rop );
DeleteDC( hdcMem );
} }
/*********************************************************************** /***********************************************************************
* MENU_CalcItemSize * MENU_CalcItemSize
* *
...@@ -812,29 +902,17 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner, ...@@ -812,29 +902,17 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
if (IS_BITMAP_ITEM(lpitem->fType)) if (IS_BITMAP_ITEM(lpitem->fType))
{ {
BITMAP bm; SIZE size;
HBITMAP resBmp = 0;
/* Check if there is a magic menu item associated with this item */
if (IS_MAGIC_ITEM(lpitem->text))
{
resBmp = MENU_LoadMagicItem((int)lpitem->text, (lpitem->fType & MF_HILITE),
lpitem->dwItemData);
}
else
resBmp = (HBITMAP)lpitem->text;
if (GetObjectA(resBmp, sizeof(bm), &bm )) MENU_GetBitmapItemSize( (int)lpitem->text, lpitem->dwItemData, &size );
lpitem->rect.right += size.cx;
lpitem->rect.bottom += size.cy;
if (TWEAK_WineLook == WIN98_LOOK)
{ {
lpitem->rect.right += bm.bmWidth;
lpitem->rect.bottom += bm.bmHeight;
if (TWEAK_WineLook == WIN98_LOOK) {
/* Leave space for the sunken border */ /* Leave space for the sunken border */
lpitem->rect.right += 2; lpitem->rect.right += 2;
lpitem->rect.bottom += 2; lpitem->rect.bottom += 2;
} }
}
} }
...@@ -1259,53 +1337,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, ...@@ -1259,53 +1337,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
/* Draw the item text or bitmap */ /* Draw the item text or bitmap */
if (IS_BITMAP_ITEM(lpitem->fType)) if (IS_BITMAP_ITEM(lpitem->fType))
{ {
int left,top,w,h; MENU_DrawBitmapItem( hdc, lpitem, &rect, menuBar );
DWORD rop;
HBITMAP resBmp = 0;
HDC hdcMem = CreateCompatibleDC( hdc );
/*
* Check if there is a magic menu item associated with this item
* and load the appropriate bitmap
*/
if (IS_MAGIC_ITEM(lpitem->text))
{
resBmp = MENU_LoadMagicItem((int)lpitem->text, (lpitem->fState & MF_HILITE),
lpitem->dwItemData);
}
else
resBmp = (HBITMAP)lpitem->text;
if (resBmp)
{
BITMAP bm;
GetObjectA( resBmp, sizeof(bm), &bm );
SelectObject(hdcMem,resBmp );
/* handle fontsize > bitmap_height */
h=rect.bottom - rect.top;
top = (h>bm.bmHeight) ?
rect.top+(h-bm.bmHeight)/2 : rect.top;
w=rect.right - rect.left;
left=rect.left;
if (TWEAK_WineLook == WIN95_LOOK) {
rop=((lpitem->fState & MF_HILITE) && !IS_MAGIC_ITEM(lpitem->text)) ? NOTSRCCOPY : SRCCOPY;
if ((lpitem->fState & MF_HILITE) && IS_BITMAP_ITEM(lpitem->fType))
SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));
} else {
left++;
w-=2;
rop=((lpitem->fState & MF_HILITE) && !IS_MAGIC_ITEM(lpitem->text) && (!menuBar)) ? MERGEPAINT : SRCCOPY;
}
BitBlt( hdc, left, top, w,
h, hdcMem, 0, 0,
rop);
}
DeleteDC( hdcMem );
return; return;
} }
......
...@@ -254,6 +254,126 @@ OBM_UPARROWD BITMAP ...@@ -254,6 +254,126 @@ OBM_UPARROWD BITMAP
'00 00' '00 00'
} }
/* BINRES obm_restored.bmp */
OBM_RESTORED BITMAP
{
'42 4D E6 00 00 00 00 00 00 00 76 00 00 00 28 00'
'00 00 10 00 00 00 0E 00 00 00 01 00 04 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 BF BF BF 00 D9 D9'
'D9 00 7F 7F 7F 00 FF FF FF 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 44 44 44 44 44 44 44 44 02 22'
'22 22 22 22 22 24 03 11 00 00 00 11 11 24 03 11'
'01 11 10 11 11 24 03 11 01 11 10 11 11 24 03 11'
'01 11 10 00 11 24 03 11 00 00 00 10 11 24 03 11'
'00 00 00 10 11 24 03 11 11 01 11 10 11 24 03 11'
'11 00 00 00 11 24 03 11 11 00 00 00 11 24 03 11'
'11 11 11 11 11 24 03 33 33 33 33 33 33 24 00 00'
'00 00 00 00 00 04'
}
/* BINRES obm_zoomd.bmp */
OBM_ZOOMD BITMAP
{
'42 4D E6 00 00 00 00 00 00 00 76 00 00 00 28 00'
'00 00 10 00 00 00 0E 00 00 00 01 00 04 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 BF BF BF 00 D9 D9'
'D9 00 7F 7F 7F 00 FF FF FF 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 44 44 44 44 44 44 44 44 02 22'
'22 22 22 22 22 24 03 11 00 00 00 00 01 24 03 11'
'01 11 11 11 01 24 03 11 01 11 11 11 01 24 03 11'
'01 11 11 11 01 24 03 11 01 11 11 11 01 24 03 11'
'01 11 11 11 01 24 03 11 01 11 11 11 01 24 03 11'
'00 00 00 00 01 24 03 11 00 00 00 00 01 24 03 11'
'11 11 11 11 11 24 03 33 33 33 33 33 33 24 00 00'
'00 00 00 00 00 00'
}
/* BINRES obm_reduced.bmp */
OBM_REDUCED BITMAP
{
'42 4D E6 00 00 00 00 00 00 00 76 00 00 00 28 00'
'00 00 10 00 00 00 0E 00 00 00 01 00 04 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 BF BF BF 00 D9 D9'
'D9 00 7F 7F 7F 00 FF FF FF 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 44 44 44 44 44 44 44 44 02 22'
'22 22 22 22 22 24 03 11 10 00 00 01 11 24 03 11'
'10 00 00 01 11 24 03 11 11 11 11 11 11 24 03 11'
'11 11 11 11 11 24 03 11 11 11 11 11 11 24 03 11'
'11 11 11 11 11 24 03 11 11 11 11 11 11 24 03 11'
'11 11 11 11 11 24 03 11 11 11 11 11 11 24 03 11'
'11 11 11 11 11 24 03 33 33 33 33 33 33 24 00 00'
'00 00 00 00 00 00'
}
/* BINRES obm_restore.bmp */
OBM_RESTORE BITMAP
{
'42 4D E6 00 00 00 00 00 00 00 76 00 00 00 28 00'
'00 00 10 00 00 00 0E 00 00 00 01 00 04 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 BF BF BF 00 D9 D9'
'D9 00 7F 7F 7F 00 FF FF FF 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 33'
'33 33 33 33 33 30 42 11 11 11 11 11 11 30 42 10'
'00 00 01 11 11 30 42 10 11 11 01 11 11 30 42 10'
'11 11 01 11 11 30 42 10 11 11 00 01 11 30 42 10'
'00 00 01 01 11 30 42 10 00 00 01 01 11 30 42 11'
'10 11 11 01 11 30 42 11 10 00 00 01 11 30 42 11'
'10 00 00 01 11 30 42 22 22 22 22 22 22 30 44 44'
'44 44 44 44 44 40'
}
/* BINRES obm_zoom.bmp */
OBM_ZOOM BITMAP
{
'42 4D E6 00 00 00 00 00 00 00 76 00 00 00 28 00'
'00 00 10 00 00 00 0E 00 00 00 01 00 04 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 BF BF BF 00 D9 D9'
'D9 00 7F 7F 7F 00 FF FF FF 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 33'
'33 33 33 33 33 30 42 11 11 11 11 11 11 30 42 10'
'00 00 00 00 11 30 42 10 11 11 11 10 11 30 42 10'
'11 11 11 10 11 30 42 10 11 11 11 10 11 30 42 10'
'11 11 11 10 11 30 42 10 11 11 11 10 11 30 42 10'
'11 11 11 10 11 30 42 10 00 00 00 00 11 30 42 10'
'00 00 00 00 11 30 42 22 22 22 22 22 22 30 44 44'
'44 44 44 44 44 40'
}
/* BINRES obm_reduce.bmp */
OBM_REDUCE BITMAP
{
'42 4D E6 00 00 00 00 00 00 00 76 00 00 00 28 00'
'00 00 10 00 00 00 0E 00 00 00 01 00 04 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 BF BF BF 00 D9 D9'
'D9 00 7F 7F 7F 00 FF FF FF 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 33'
'33 33 33 33 33 30 42 11 11 11 11 11 11 30 42 11'
'00 00 00 11 11 30 42 11 00 00 00 11 11 30 42 11'
'11 11 11 11 11 30 42 11 11 11 11 11 11 30 42 11'
'11 11 11 11 11 30 42 11 11 11 11 11 11 30 42 11'
'11 11 11 11 11 30 42 11 11 11 11 11 11 30 42 11'
'11 11 11 11 11 30 42 22 22 22 22 22 22 30 44 44'
'44 44 44 44 44 40'
}
/* BINRES obm_lfarrow.bmp */ /* BINRES obm_lfarrow.bmp */
OBM_LFARROW BITMAP OBM_LFARROW BITMAP
{ {
...@@ -358,6 +478,41 @@ OBM_UPARROW BITMAP ...@@ -358,6 +478,41 @@ OBM_UPARROW BITMAP
'00 00' '00 00'
} }
/* BINRES obm_close.bmp */
OBM_CLOSE BITMAP
{
'42 4D DE 01 00 00 00 00 00 00 76 00 00 00 28 00'
'00 00 24 00 00 00 12 00 00 00 01 00 04 00 00 00'
'00 00 68 01 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80'
'00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80'
'00 00 80 80 80 00 C0 C0 C0 00 00 00 FF 00 00 FF'
'00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF'
'00 00 FF FF FF 00 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 00 00 88 88 88 70 07 88'
'88 88 88 88 88 88 70 07 88 88 88 88 00 00 88 88'
'80 00 78 88 88 88 88 88 88 80 00 78 88 88 88 88'
'00 00 88 87 00 00 88 88 88 88 88 88 87 00 00 88'
'88 88 88 88 00 00 88 88 88 70 88 88 88 88 88 88'
'88 88 70 88 88 88 88 88 00 00 88 88 88 80 78 88'
'88 88 88 88 88 88 80 78 88 88 88 88 00 00 88 88'
'88 80 08 88 88 88 88 88 88 88 80 08 88 88 88 88'
'00 00 88 88 88 80 10 88 88 88 88 88 88 88 80 10'
'88 88 88 88 00 00 88 88 88 80 91 08 88 88 88 88'
'88 88 80 91 08 88 88 88 00 00 88 88 88 80 19 10'
'88 88 88 88 88 88 80 19 10 88 88 88 00 00 88 88'
'88 80 91 90 78 88 88 88 88 88 80 91 90 78 88 88'
'00 00 88 88 88 80 19 19 08 88 88 88 88 88 80 19'
'19 08 88 88 00 00 88 88 88 80 91 91 07 88 88 88'
'88 88 80 91 91 07 88 88 00 00 88 88 88 87 0F 89'
'10 88 88 88 88 88 87 0F 89 10 88 88 00 00 88 88'
'88 88 08 F8 F0 88 88 88 88 88 88 08 F8 F0 88 88'
'00 00 88 88 88 88 0F 8F 08 88 88 88 88 88 88 0F'
'8F 08 88 88 00 00 88 88 88 88 70 00 88 88 88 88'
'88 88 88 70 00 88 88 88 00 00 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 00 00'
}
/* BINRES obm_old_restore.bmp */ /* BINRES obm_old_restore.bmp */
OBM_OLD_RESTORE BITMAP OBM_OLD_RESTORE BITMAP
{ {
...@@ -536,18 +691,34 @@ OBM_SIZE BITMAP ...@@ -536,18 +691,34 @@ OBM_SIZE BITMAP
/* BINRES obm_old_close.bmp */ /* BINRES obm_old_close.bmp */
OBM_OLD_CLOSE BITMAP OBM_OLD_CLOSE BITMAP
{ {
'42 4D D6 00 00 00 00 00 00 00 3E 00 00 00 28 00' '42 4D DE 01 00 00 00 00 00 00 76 00 00 00 28 00'
'00 00 32 00 00 00 13 00 00 00 01 00 01 00 00 00' '00 00 24 00 00 00 12 00 00 00 01 00 04 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' '00 00 68 01 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 FF FF FF 00 FF FF' '00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80'
'FF FF FF FF C0 00 FF FF FF FF FF FF C0 00 FF FF' '00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80'
'FF FF FF FF C0 00 FF FF FF FF FF FF C0 00 FF FF' '00 00 80 80 80 00 C0 C0 C0 00 00 00 FF 00 00 FF'
'FF FF FF FF C0 00 FF FF FF FF FF FF C0 00 FF FF' '00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF'
'FF FF FF FF C0 00 E0 00 01 FF C0 0F C0 00 C0 00' '00 00 FF FF FF 00 88 88 88 88 88 88 88 88 88 88'
'01 FF 80 0F C0 00 DF FF F9 FF BF CF C0 00 DF FF' '88 88 88 88 88 88 88 88 00 00 88 88 88 88 88 88'
'F9 FF BF CF C0 00 C0 00 03 FF 80 1F C0 00 FF FF' '88 88 88 88 88 88 88 88 88 88 88 88 00 00 88 88'
'FF FF FF FF C0 00 FF FF FF FF FF FF C0 00 FF FF' '88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
'FF FF FF FF C0 00 FF FF FF FF FF FF C0 00 FF FF' '00 00 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
'FF FF FF FF C0 00 FF FF FF FF FF FF C0 00 FF FF' '88 88 88 88 00 00 88 88 88 88 88 88 88 88 88 88'
'FF FF FF FF C0 00' '88 88 88 88 88 88 88 88 00 00 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 00 00 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
'00 00 88 87 77 77 77 77 77 77 88 88 88 88 87 77'
'77 77 88 88 00 00 88 00 00 00 00 00 00 07 88 88'
'88 88 00 00 00 07 88 88 00 00 88 0F FF FF FF FF'
'FF 07 88 88 88 88 0F FF FF 07 88 88 00 00 88 00'
'00 00 00 00 00 08 88 88 88 88 00 00 00 08 88 88'
'00 00 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 00 00 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 00 00 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 00 00 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
'00 00 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 00 00 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 00 00 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 00 00'
} }
...@@ -2115,7 +2115,6 @@ static HBITMAP BITMAP_Load( HINSTANCE instance,LPCWSTR name, UINT loadflags ) ...@@ -2115,7 +2115,6 @@ static HBITMAP BITMAP_Load( HINSTANCE instance,LPCWSTR name, UINT loadflags )
{ {
/* OEM bitmap: try to load the resource from user32.dll */ /* OEM bitmap: try to load the resource from user32.dll */
if (HIWORD(name)) return 0; if (HIWORD(name)) return 0;
if ((hbitmap = USER_Driver.pLoadOEMResource( LOWORD(name), OEM_BITMAP ))) return hbitmap;
if (!(instance = GetModuleHandleA("user32.dll"))) return 0; if (!(instance = GetModuleHandleA("user32.dll"))) return 0;
} }
if (!(hRsrc = FindResourceW( instance, name, RT_BITMAPW ))) return 0; if (!(hRsrc = FindResourceW( instance, name, RT_BITMAPW ))) return 0;
......
...@@ -117,7 +117,6 @@ typedef struct ...@@ -117,7 +117,6 @@ typedef struct
} MDICLIENTINFO; } MDICLIENTINFO;
static HBITMAP hBmpClose = 0; static HBITMAP hBmpClose = 0;
static HBITMAP hBmpRestore = 0;
/* ----------------- declarations ----------------- */ /* ----------------- declarations ----------------- */
static void MDI_UpdateFrameText( HWND, HWND, BOOL, LPCWSTR); static void MDI_UpdateFrameText( HWND, HWND, BOOL, LPCWSTR);
...@@ -816,7 +815,7 @@ static HBITMAP CreateMDIMenuBitmap(void) ...@@ -816,7 +815,7 @@ static HBITMAP CreateMDIMenuBitmap(void)
{ {
HDC hDCSrc = CreateCompatibleDC(0); HDC hDCSrc = CreateCompatibleDC(0);
HDC hDCDest = CreateCompatibleDC(hDCSrc); HDC hDCDest = CreateCompatibleDC(hDCSrc);
HBITMAP hbClose = LoadBitmapW(0, MAKEINTRESOURCEW(OBM_CLOSE) ); HBITMAP hbClose = LoadBitmapW(0, MAKEINTRESOURCEW(OBM_OLD_CLOSE) );
HBITMAP hbCopy; HBITMAP hbCopy;
HBITMAP hobjSrc, hobjDest; HBITMAP hobjSrc, hobjDest;
...@@ -1243,11 +1242,7 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message, ...@@ -1243,11 +1242,7 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
ci->mdiFlags = 0; ci->mdiFlags = 0;
SetWindowLongW( hwnd, GWL_STYLE, GetWindowLongW(hwnd,GWL_STYLE) | WS_CLIPCHILDREN ); SetWindowLongW( hwnd, GWL_STYLE, GetWindowLongW(hwnd,GWL_STYLE) | WS_CLIPCHILDREN );
if (!hBmpClose) if (!hBmpClose) hBmpClose = CreateMDIMenuBitmap();
{
hBmpClose = CreateMDIMenuBitmap();
hBmpRestore = LoadBitmapW( 0, MAKEINTRESOURCEW(OBM_RESTORE) );
}
if (ci->hWindowMenu != 0) if (ci->hWindowMenu != 0)
AppendMenuW( ci->hWindowMenu, MF_SEPARATOR, 0, NULL ); AppendMenuW( ci->hWindowMenu, MF_SEPARATOR, 0, NULL );
......
...@@ -27,12 +27,6 @@ DECLARE_DEBUG_CHANNEL(shell); ...@@ -27,12 +27,6 @@ DECLARE_DEBUG_CHANNEL(shell);
BOOL NC_DrawGrayButton(HDC hdc, int x, int y); BOOL NC_DrawGrayButton(HDC hdc, int x, int y);
static HBITMAP hbitmapClose; static HBITMAP hbitmapClose;
static HBITMAP hbitmapMinimize;
static HBITMAP hbitmapMinimizeD;
static HBITMAP hbitmapMaximize;
static HBITMAP hbitmapMaximizeD;
static HBITMAP hbitmapRestore;
static HBITMAP hbitmapRestoreD;
static const BYTE lpGrayMask[] = { 0xAA, 0xA0, static const BYTE lpGrayMask[] = { 0xAA, 0xA0,
0x55, 0x50, 0x55, 0x50,
...@@ -871,18 +865,15 @@ void NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down ) ...@@ -871,18 +865,15 @@ void NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down )
static void NC_DrawMaxButton( HWND hwnd, HDC16 hdc, BOOL down ) static void NC_DrawMaxButton( HWND hwnd, HDC16 hdc, BOOL down )
{ {
RECT rect; RECT rect;
HDC hdcMem; UINT flags = IsZoomed(hwnd) ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMAX;
NC_GetInsideRect( hwnd, &rect ); NC_GetInsideRect( hwnd, &rect );
hdcMem = CreateCompatibleDC( hdc ); rect.left = rect.right - GetSystemMetrics(SM_CXSIZE) + 1;
SelectObject( hdcMem, (IsZoomed(hwnd) rect.bottom = rect.top + GetSystemMetrics(SM_CYSIZE) - 1;
? (down ? hbitmapRestoreD : hbitmapRestore) rect.top += 1;
: (down ? hbitmapMaximizeD : hbitmapMaximize)) ); rect.right -= 1;
BitBlt( hdc, rect.right - GetSystemMetrics(SM_CXSIZE) - 1, rect.top, if (down) flags |= DFCS_PUSHED;
GetSystemMetrics(SM_CXSIZE) + 1, GetSystemMetrics(SM_CYSIZE), hdcMem, 0, 0, DrawFrameControl( hdc, &rect, DFC_CAPTION, flags );
SRCCOPY );
DeleteDC( hdcMem );
} }
...@@ -892,17 +883,18 @@ static void NC_DrawMaxButton( HWND hwnd, HDC16 hdc, BOOL down ) ...@@ -892,17 +883,18 @@ static void NC_DrawMaxButton( HWND hwnd, HDC16 hdc, BOOL down )
static void NC_DrawMinButton( HWND hwnd, HDC16 hdc, BOOL down ) static void NC_DrawMinButton( HWND hwnd, HDC16 hdc, BOOL down )
{ {
RECT rect; RECT rect;
HDC hdcMem; UINT flags = DFCS_CAPTIONMIN;
DWORD style = GetWindowLongA( hwnd, GWL_STYLE );
NC_GetInsideRect( hwnd, &rect ); NC_GetInsideRect( hwnd, &rect );
hdcMem = CreateCompatibleDC( hdc ); if (style & (WS_MAXIMIZEBOX|WS_MINIMIZEBOX))
SelectObject( hdcMem, (down ? hbitmapMinimizeD : hbitmapMinimize) ); rect.right -= GetSystemMetrics(SM_CXSIZE) - 2;
if (GetWindowLongA(hwnd,GWL_STYLE) & WS_MAXIMIZEBOX) rect.left = rect.right - GetSystemMetrics(SM_CXSIZE) + 1;
rect.right -= GetSystemMetrics(SM_CXSIZE)+1; rect.bottom = rect.top + GetSystemMetrics(SM_CYSIZE) - 1;
BitBlt( hdc, rect.right - GetSystemMetrics(SM_CXSIZE) - 1, rect.top, rect.top += 1;
GetSystemMetrics(SM_CXSIZE) + 1, GetSystemMetrics(SM_CYSIZE), hdcMem, 0, 0, rect.right -= 1;
SRCCOPY ); if (down) flags |= DFCS_PUSHED;
DeleteDC( hdcMem ); DrawFrameControl( hdc, &rect, DFC_CAPTION, flags );
} }
...@@ -1226,13 +1218,7 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd, ...@@ -1226,13 +1218,7 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd,
if (!hbitmapClose) if (!hbitmapClose)
{ {
if (!(hbitmapClose = LoadBitmapA( 0, MAKEINTRESOURCEA(OBM_CLOSE) ))) return; if (!(hbitmapClose = LoadBitmapA( 0, MAKEINTRESOURCEA(OBM_OLD_CLOSE) ))) return;
hbitmapMinimize = LoadBitmapA( 0, MAKEINTRESOURCEA(OBM_REDUCE) );
hbitmapMinimizeD = LoadBitmapA( 0, MAKEINTRESOURCEA(OBM_REDUCED) );
hbitmapMaximize = LoadBitmapA( 0, MAKEINTRESOURCEA(OBM_ZOOM) );
hbitmapMaximizeD = LoadBitmapA( 0, MAKEINTRESOURCEA(OBM_ZOOMD) );
hbitmapRestore = LoadBitmapA( 0, MAKEINTRESOURCEA(OBM_RESTORE) );
hbitmapRestoreD = LoadBitmapA( 0, MAKEINTRESOURCEA(OBM_RESTORED) );
} }
if (GetWindowLongA( hwnd, GWL_EXSTYLE) & WS_EX_DLGMODALFRAME) if (GetWindowLongA( hwnd, GWL_EXSTYLE) & WS_EX_DLGMODALFRAME)
...@@ -1255,6 +1241,7 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd, ...@@ -1255,6 +1241,7 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd,
MoveToEx( hdc, r.left - 1, r.top, NULL ); MoveToEx( hdc, r.left - 1, r.top, NULL );
LineTo( hdc, r.left - 1, r.bottom ); LineTo( hdc, r.left - 1, r.bottom );
} }
FillRect( hdc, &r, GetSysColorBrush(active ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION) );
if (style & WS_MAXIMIZEBOX) if (style & WS_MAXIMIZEBOX)
{ {
NC_DrawMaxButton( hwnd, hdc, FALSE ); NC_DrawMaxButton( hwnd, hdc, FALSE );
...@@ -1266,9 +1253,6 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd, ...@@ -1266,9 +1253,6 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd,
r.right -= GetSystemMetrics(SM_CXSIZE) + 1; r.right -= GetSystemMetrics(SM_CXSIZE) + 1;
} }
FillRect( hdc, &r, GetSysColorBrush(active ? COLOR_ACTIVECAPTION :
COLOR_INACTIVECAPTION) );
if (GetWindowTextA( hwnd, buffer, sizeof(buffer) )) if (GetWindowTextA( hwnd, buffer, sizeof(buffer) ))
{ {
if (active) SetTextColor( hdc, GetSysColor( COLOR_CAPTIONTEXT ) ); if (active) SetTextColor( hdc, GetSysColor( COLOR_CAPTIONTEXT ) );
......
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