[英]MFC context menu has incorrect height of items
In my MFC app I create an context menu: 在我的MFC应用程序中,我创建一个上下文菜单:
CString strName;
strName.LoadString(IDS_EDIT_MENU);
GetContextMenuManager()->AddMenu(strName, IDR_POPUP_EDIT);
This menu is described in a resource file as usual: 通常在资源文件中描述此菜单:
IDR_POPUP_EDIT MENU
BEGIN
POPUP "Edit"
BEGIN
MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT
MENUITEM "Copy\tCtrl+C", ID_EDIT_COPY
MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
END
END
Once in the code I show this menu in a right button handler: 一旦在代码中,我就在右键按钮处理程序中显示此菜单:
theApp.GetContextMenuManager()->ShowPopupMenu(IDR_POPUP_EDIT, point.x, point.y, this, TRUE);
It has icons 16x16 and it is shown good. 它具有图标16x16,并且显示良好。 But then I added a floating toolbar, which has icons 32x32.
但是随后我添加了一个浮动工具栏,该工具栏具有图标32x32。
if (!m_notesToolbar.CreateEx(this,
TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
CRect(1, 1, 1, 1), ID_NOTES_TOOLBAR) ||
!m_notesToolbar.LoadToolBar(IDR_NOTES_TOOLBAR))
{
TRACE0("Failed to create toolbar\n");
return -1;
}
m_notesToolbar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_notesToolbar);
So, now the context menu also has height of items 32 pixels. 因此,现在上下文菜单的项目高度也为32像素。 Why?
为什么? And how can I have these GUI objects of different heights?
以及如何具有这些不同高度的GUI对象?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.