Setup menu drawing colors before calling owner draw routine.
This commit is contained in:
parent
9de14a1c11
commit
7214fdfca4
|
@ -1116,6 +1116,30 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
|
|||
return;
|
||||
}
|
||||
|
||||
/* Setup colors */
|
||||
|
||||
if (lpitem->fState & MF_HILITE)
|
||||
{
|
||||
if(menuBar) {
|
||||
SetTextColor(hdc, GetSysColor(COLOR_MENUTEXT));
|
||||
SetBkColor(hdc, GetSysColor(COLOR_MENU));
|
||||
} else {
|
||||
if(lpitem->fState & MF_GRAYED)
|
||||
SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
|
||||
else
|
||||
SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));
|
||||
SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lpitem->fState & MF_GRAYED)
|
||||
SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
|
||||
else
|
||||
SetTextColor( hdc, GetSysColor( COLOR_MENUTEXT ) );
|
||||
SetBkColor( hdc, GetSysColor( COLOR_MENU ) );
|
||||
}
|
||||
|
||||
if (lpitem->fType & MF_OWNERDRAW)
|
||||
{
|
||||
/*
|
||||
|
@ -1195,30 +1219,6 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
|
|||
}
|
||||
}
|
||||
|
||||
/* Setup colors */
|
||||
|
||||
if (lpitem->fState & MF_HILITE)
|
||||
{
|
||||
if(menuBar) {
|
||||
SetTextColor(hdc, GetSysColor(COLOR_MENUTEXT));
|
||||
SetBkColor(hdc, GetSysColor(COLOR_MENU));
|
||||
} else {
|
||||
if(lpitem->fState & MF_GRAYED)
|
||||
SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
|
||||
else
|
||||
SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));
|
||||
SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lpitem->fState & MF_GRAYED)
|
||||
SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
|
||||
else
|
||||
SetTextColor( hdc, GetSysColor( COLOR_MENUTEXT ) );
|
||||
SetBkColor( hdc, GetSysColor( COLOR_MENU ) );
|
||||
}
|
||||
|
||||
/* helper lines for debugging */
|
||||
/* FrameRect(hdc, &rect, GetStockObject(BLACK_BRUSH));
|
||||
SelectObject( hdc, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) );
|
||||
|
|
Loading…
Reference in New Issue