首页上一页 1 下一页尾页 5 条记录 1/1页
vc++实战突击 第三章 图像处理
发表在C语言图书答疑
2012-05-16
是否精华
是
否
版块置顶:
是
否
设置时间:
非永久
永久
起始时间:
结束时间:
是否扣分:
是
否
m_Menu.SetMenuItemInfo(&m_Menu); 设置菜单信息
我想问一下菜单信息在什么地方 我想修改一下菜单栏的大小 高低 麻烦老师解决一下
我想问一下菜单信息在什么地方 我想修改一下菜单栏的大小 高低 麻烦老师解决一下
精彩评论 5
2012-05-18
4L
case 9: //顶层菜单
{
DrawTopMenuBk(pDC,Rect,(m_state & ODS_SELECTED)||(m_state & 0x0040)); //0x0040 ==ODS_HOTLIGHT
SetMenuItemText(pDC,str.GetBuffer(100),Rect);
break;
}
case -1:
{
SetMenuItemText(pDC,str.GetBuffer(100),Rect);
break;
}
case 11:
{
DrawSepMenu(pDC,Rect);
break;
{
DrawTopMenuBk(pDC,Rect,(m_state & ODS_SELECTED)||(m_state & 0x0040)); //0x0040 ==ODS_HOTLIGHT
SetMenuItemText(pDC,str.GetBuffer(100),Rect);
break;
}
case -1:
{
SetMenuItemText(pDC,str.GetBuffer(100),Rect);
break;
}
case 11:
{
DrawSepMenu(pDC,Rect);
break;
2012-05-18
5L
void CCustomMenu::DrawItem( LPDRAWITEMSTRUCT lpStruct )
{
if (lpStruct->CtlType==ODT_MENU)
{
if(lpStruct->itemData == NULL)
return;
unsigned int m_state = lpStruct->itemState;
CDC* pDC = CDC::FromHandle(lpStruct->hDC);
CString str = ((CMenuItem*)(lpStruct->itemData))->m_MenuText;
int MenuID = ((CMenuItem*)(lpStruct->itemData))->m_MenuType;
CRect Rect = lpStruct->rcItem;
pDC->SetBkMode(TRANSPARENT);
switch(MenuID)
{
case 9: //顶层菜单
{
DrawTopMenuBk(pDC,Rect,(m_state & ODS_SELECTED)||(m_state & 0x0040)); //0x0040 ==ODS_HOTLIGHT
SetMenuItemText(pDC,str.GetBuffer(0),Rect);
break;
}
case -1:
{
SetMenuItemText(pDC,str.GetBuffer(0),Rect);
break;
}
case 11:
{
DrawSepMenu(pDC,Rect);
break;
}
default:
{
if (m_RandColor)
{
int srcred = rand() % 255;
int srcblue = rand() % 255;
int srcgreen = rand() % 255;
int desred = rand() % 255;
int desblue = rand() % 255;
int desgreen = rand() % 255;
DrawMenuBk(pDC,Rect,RGB(srcred,srcgreen,srcblue),RGB(desred,desgreen,desblue),m_state & ODS_SELECTED);
}
else
{
DrawMenuBk(pDC,Rect,0xfaa0,0xf00ff,m_state & ODS_SELECTED);
}
SetMenuItemText(pDC,str.GetBuffer(70),Rect);
break;
}
}
}
}
{
if (lpStruct->CtlType==ODT_MENU)
{
if(lpStruct->itemData == NULL)
return;
unsigned int m_state = lpStruct->itemState;
CDC* pDC = CDC::FromHandle(lpStruct->hDC);
CString str = ((CMenuItem*)(lpStruct->itemData))->m_MenuText;
int MenuID = ((CMenuItem*)(lpStruct->itemData))->m_MenuType;
CRect Rect = lpStruct->rcItem;
pDC->SetBkMode(TRANSPARENT);
switch(MenuID)
{
case 9: //顶层菜单
{
DrawTopMenuBk(pDC,Rect,(m_state & ODS_SELECTED)||(m_state & 0x0040)); //0x0040 ==ODS_HOTLIGHT
SetMenuItemText(pDC,str.GetBuffer(0),Rect);
break;
}
case -1:
{
SetMenuItemText(pDC,str.GetBuffer(0),Rect);
break;
}
case 11:
{
DrawSepMenu(pDC,Rect);
break;
}
default:
{
if (m_RandColor)
{
int srcred = rand() % 255;
int srcblue = rand() % 255;
int srcgreen = rand() % 255;
int desred = rand() % 255;
int desblue = rand() % 255;
int desgreen = rand() % 255;
DrawMenuBk(pDC,Rect,RGB(srcred,srcgreen,srcblue),RGB(desred,desgreen,desblue),m_state & ODS_SELECTED);
}
else
{
DrawMenuBk(pDC,Rect,0xfaa0,0xf00ff,m_state & ODS_SELECTED);
}
SetMenuItemText(pDC,str.GetBuffer(70),Rect);
break;
}
}
}
}