1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
case WM_ERASEBKGND:
{
return TRUE;
}
break;
case WM_CTLCOLORSTATIC:
{
return (LRESULT)GetStockObject(NULL_BRUSH);
}
break;
case WM_DRAWITEM:
{
DRAWITEMSTRUCT *test=(DRAWITEMSTRUCT*) lParam;
image imglabel(test->rcItem.right-test->rcItem.left,test->rcItem.bottom-test->rcItem.top);
if(inst->blnTransparent!=true)
FillRect(test->hDC,&test->rcItem, CreateSolidBrush(inst->clrBackColor));
else
FillRect(test->hDC,&test->rcItem,(HBRUSH) GetStockObject(NULL_BRUSH));
FillRect(imglabel,&test->rcItem,CreateSolidBrush(inst->clrBackColor));
if(inst->imgtest.haveimage())
DrawHICONtoHDC(imglabel, inst->imgtest,1,1);
SetBkMode(imglabel,TRANSPARENT);
char *text=(char*)inst->strCaption.c_str();
SetTextColor(imglabel,inst->clrTextColor );
DrawTextEx(imglabel,text,-1,&test->rcItem,DT_LEFT,NULL);
if(inst->blnBorder==true)
DrawEdge(imglabel, &test->rcItem,BDR_SUNKENINNER | BDR_RAISEDOUTER,BF_RECT);
imglabel.Backcolor=inst->clrBackColor;
TransparentBlt(test->hDC,0,0,test->rcItem.right,test->rcItem.bottom,imglabel,0,0,test->rcItem.right,test->rcItem.bottom, inst->clrBackColor);
}
break;
|