Make bitmap menu items look like in windows when selected,

i.e. inverted and hilited (in Win98 look).
This commit is contained in:
Dmitry Timoshkov 2000-11-01 02:11:41 +00:00 committed by Alexandre Julliard
parent e3810e3acc
commit d0ff2ec08b
1 changed files with 39 additions and 14 deletions

View File

@ -1114,11 +1114,21 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
if (!(lpitem->fType & MF_OWNERDRAW)) if (!(lpitem->fType & MF_OWNERDRAW))
{ {
if ((lpitem->fState & MF_HILITE) && !(IS_BITMAP_ITEM(lpitem->fType))) if (lpitem->fState & MF_HILITE)
if ((menuBar) && (TWEAK_WineLook==WIN98_LOOK)) {
if(TWEAK_WineLook == WIN98_LOOK)
{
if(menuBar)
DrawEdge(hdc, &rect, BDR_SUNKENOUTER, BF_RECT); DrawEdge(hdc, &rect, BDR_SUNKENOUTER, BF_RECT);
else else
FillRect( hdc, &rect, GetSysColorBrush(COLOR_HIGHLIGHT) ); FillRect(hdc, &rect, GetSysColorBrush(COLOR_HIGHLIGHT));
}
else /* Not Win98 Look */
{
if(!IS_BITMAP_ITEM(lpitem->fType))
FillRect(hdc, &rect, GetSysColorBrush(COLOR_HIGHLIGHT));
}
}
else else
FillRect( hdc, &rect, GetSysColorBrush(COLOR_MENU) ); FillRect( hdc, &rect, GetSysColorBrush(COLOR_MENU) );
} }
@ -1168,15 +1178,29 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
/* Setup colors */ /* Setup colors */
if ((lpitem->fState & MF_HILITE) && !(IS_BITMAP_ITEM(lpitem->fType)) ) if (lpitem->fState & MF_HILITE)
{ {
if (lpitem->fState & MF_GRAYED) if(TWEAK_WineLook == WIN98_LOOK)
SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) ); {
else if ((menuBar) && (TWEAK_WineLook==WIN98_LOOK)) if(menuBar)
SetTextColor( hdc, GetSysColor( COLOR_MENUTEXT ) ); SetTextColor(hdc, GetSysColor(COLOR_MENUTEXT));
else else
SetTextColor( hdc, GetSysColor( COLOR_HIGHLIGHTTEXT ) ); {
SetBkColor( hdc, GetSysColor( COLOR_HIGHLIGHT ) ); if(lpitem->fState & MF_GRAYED)
SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
else
SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));
}
SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));
}
else /* Not Win98 Look */
{
SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));
if(!IS_BITMAP_ITEM(lpitem->fType))
SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));
else
SetBkColor(hdc, GetSysColor(COLOR_MENU));
}
} }
else else
{ {
@ -1285,7 +1309,8 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
rect.top+(rect.bottom-rect.top-bm.bmHeight)/2 : rect.top; rect.top+(rect.bottom-rect.top-bm.bmHeight)/2 : rect.top;
BitBlt( hdc, rect.left, top, rect.right - rect.left, BitBlt( hdc, rect.left, top, rect.right - rect.left,
rect.bottom - rect.top, hdcMem, 0, 0, SRCCOPY ); rect.bottom - rect.top, hdcMem, 0, 0,
(lpitem->fState & MF_HILITE) ? NOTSRCCOPY : SRCCOPY );
} }
DeleteDC( hdcMem ); DeleteDC( hdcMem );