本文整理汇总了C++中CChildFrame::EditCommanderContextMenu方法的典型用法代码示例。如果您正苦于以下问题:C++ CChildFrame::EditCommanderContextMenu方法的具体用法?C++ CChildFrame::EditCommanderContextMenu怎么用?C++ CChildFrame::EditCommanderContextMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChildFrame
的用法示例。
在下文中一共展示了CChildFrame::EditCommanderContextMenu方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnRButtonDown
void CNuGenDimensionView::OnRButtonDown(UINT nFlags, CPoint point)
{
CChildFrame* pFrame = static_cast<CChildFrame*>(GetParentFrame());
if (!pFrame->m_commander && !Drawer::CurrentHotObject)
{
CEGMenu menu;
menu.CreatePopupMenu();
int nItem=0;
UINT chs=0;
chs = (sgGetScene()->GetObjectsList()->GetCount()!=0)?MF_ENABLED:MF_GRAYED;
menu.InsertMenu(nItem++, MF_BYPOSITION|chs, ID_ALL_SCENE_VIEW, GetLeftHalfOfString(ID_ALL_SCENE_VIEW));
menu.InsertMenu(nItem++, MF_BYPOSITION|MF_SEPARATOR);
chs = (!m_Camera.m_bPerspective)?MF_CHECKED:0;
menu.InsertMenu(nItem++, MF_BYPOSITION|chs , ID_PARALL_PROJ, GetLeftHalfOfString(ID_PARALL_PROJ));
chs = (m_Camera.m_bPerspective)?MF_CHECKED:0;
menu.InsertMenu(nItem++, MF_BYPOSITION|chs, ID_PERSPECT_PROJ, GetLeftHalfOfString(ID_PERSPECT_PROJ));
menu.InsertMenu(nItem++, MF_BYPOSITION|MF_SEPARATOR);
chs = (m_Camera.m_enumCameraPosition==CP_FRONT)?MF_CHECKED:0;
menu.InsertMenu(nItem++, MF_BYPOSITION|chs, ID_FRONT_VIEW, GetLeftHalfOfString(ID_FRONT_VIEW));
chs = (m_Camera.m_enumCameraPosition==CP_BACK)?MF_CHECKED:0;
menu.InsertMenu(nItem++, MF_BYPOSITION|chs, ID_BACK_VIEW, GetLeftHalfOfString(ID_BACK_VIEW));
chs = (m_Camera.m_enumCameraPosition==CP_TOP)?MF_CHECKED:0;
menu.InsertMenu(nItem++, MF_BYPOSITION|chs , ID_TOP_VIEW, GetLeftHalfOfString(ID_TOP_VIEW));
chs = (m_Camera.m_enumCameraPosition==CP_BOTTOM)?MF_CHECKED:0;
menu.InsertMenu(nItem++, MF_BYPOSITION|chs , ID_BOTTOM_VIEW, GetLeftHalfOfString(ID_BOTTOM_VIEW));
chs = (m_Camera.m_enumCameraPosition==CP_LEFT)?MF_CHECKED:0;
menu.InsertMenu(nItem++, MF_BYPOSITION|chs, ID_LEFT_VIEW, GetLeftHalfOfString(ID_LEFT_VIEW));
chs = (m_Camera.m_enumCameraPosition==CP_RIGHT)?MF_CHECKED:0;
menu.InsertMenu(nItem++, MF_BYPOSITION|chs , ID_RIGHT_VIEW, GetLeftHalfOfString(ID_RIGHT_VIEW));
menu.InsertMenu(nItem++, MF_BYPOSITION|MF_SEPARATOR);
chs = (m_Camera.m_enumCameraPosition==CP_ISO_FRONT)?MF_CHECKED:0;
menu.InsertMenu(nItem++, MF_BYPOSITION|chs, ID_ISO_FRONT_VIEW, GetLeftHalfOfString(ID_ISO_FRONT_VIEW));
chs = (m_Camera.m_enumCameraPosition==CP_ISO_BACK)?MF_CHECKED:0;
menu.InsertMenu(nItem++, MF_BYPOSITION|chs , ID_ISO_BACK_VIEW, GetLeftHalfOfString(ID_ISO_BACK_VIEW));
//menu.InsertMenu(nItem++, MF_BYPOSITION|MF_SEPARATOR);
menu.LoadToolBar( cm_icons, RGB(0,0,0) );
//menu.SetDefaultItem(ID_EDIT_PASTE);
CRect clR;
GetWindowRect(&clR);
menu.TrackPopupMenu( TPM_LEFTALIGN | TPM_LEFTBUTTON |
TPM_RIGHTBUTTON|0x0000, point.x+clR.left,point.y+clR.top, this);
}
else
{
if (pFrame->m_commander)
{
CRect clR;
GetWindowRect(&clR);
pFrame->CommanderContextMenu(point.x+clR.left,point.y+clR.top);
}
else if (Drawer::CurrentHotObject)
{
CRect clR;
GetWindowRect(&clR);
pFrame->EditCommanderContextMenu(point.x+clR.left,point.y+clR.top);
}
}
COpenGLView::OnRButtonDown(nFlags, point);
}