= dc.gettextcolor();
colorref rgbbkcolor = dc.getbkcolor();
if (lpdrawitemstruct->itemaction & oda_focus)
{
dc.drawfocusrect(&lpdrawitemstruct->rcitem);
}
else if (lpdrawitemstruct->itemaction & oda_drawentire)
{
if (lpdrawitemstruct->itemstate & ods_focus)
dc.drawfocusrect(&lpdrawitemstruct->rcitem);
else
dc.exttextout(0, 0, eto_opaque, &lpdrawitemstruct->rcitem, _t(""), 0, null);
}
if (0 <= (int)lpdrawitemstruct->itemid) // any item selected?
{
::inflaterect(&lpdrawitemstruct->rcitem, -2, -2);
dc.fillsolidrect(&lpdrawitemstruct->rcitem, (colorref)lpdrawitemstruct->itemdata);
dc.framerect(&lpdrawitemstruct->rcitem, &brushblack);
}
// restore the dc state
dc.settextcolor(rgbtextcolor);
dc.setbkcolor(rgbbkcolor);
dc.detach();
}
colorref ccombocolorpicker::getselectedcolor()
{
int nitem = getcursel();
if (cb_err == nitem)
return rgb(0, 0, 0); // default to black if nothing is selected
return m_rgstandardcolors[nitem];
}
以上只是一个很简单的类,功能还很不完善,由于本人的VC水平还是菜鸟等级的,没有能力把它给扩展了,我很希望有读者能把它给扩展了,到时候可别忘记给我发一个。谢谢!
译于2001年9月9号。