// JP opened flex table

Click to See Complete Forum and Search --> : FIX: Owner Drawn Menu with Icons(4) (automatically uses toolbar res)


Frederic J.F. Estrampes
March 18th, 1998, 07:26 PM
I have noticed a small problem with the 3D display of disabled accelerator keys. The 3D look of the text after the tab (accelerator key) has a wrong offset.


This can be easily fixed by adding one line of code to the DrawItem function (see below).


bool CMenuSpawn::DrawItem(LPDRAWITEMSTRUCT lp)

{

.......

.......


if (!bEnab)


{


if (!bSelect)


{


CRect rcText1(rcText);


rcText1.InflateRect(-1,-1);


pDC->SetTextColor(GetSysColor(COLOR_3DHILIGHT));


pDC->DrawText(cs, rcText1, DT_VCENTER|DT_LEFT);


//***** BEGIN MODIFICATION*****


rcText1.InflateRect(2,0);


//***** END MODIFICATION*****


pDC->DrawText(cs1, rcText1, DT_VCENTER|DT_RIGHT);


pDC->SetTextColor(GetSysColor(COLOR_GRAYTEXT));


pDC->DrawText(cs, rcText, DT_VCENTER|DT_LEFT);


pDC->DrawText(cs1, rcText, DT_VCENTER|DT_RIGHT);


}


else


{


pDC->SetTextColor(GetSysColor(COLOR_MENU));


pDC->DrawText(cs, rcText, DT_VCENTER|DT_LEFT);


pDC->DrawText(cs1, rcText, DT_VCENTER|DT_RIGHT);


}


}

......

......

}

//JP added flex table