如何显示下拉菜单功能区自定义对话框? [英] How to show drop down menus ribbon customize dialog?

查看:97
本文介绍了如何显示下拉菜单功能区自定义对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MFC创建功能区。从"从中选择命令"中选择类别时,默认  CMFCRibbonCustomizeDialog在自定义对话框中仅显示该类别中的面板。所以我创建了自己的MYRibbonCustomizeDialog,它是从CMFCRibbonCustomizeDialog派生的
,以及从CMFCRibbonCustomizePropertyPage派生的MYRibbonCustomizePropertyPage,并覆盖CMFCRibbonCustomizePropertyPage :: OnSelendokCategoryCombo(),其中我初始化了m_wndCommandsList,
但是似乎m_wndCommandsList忽略了下拉菜单。例如,在一个类别中,我有5个元素,并且我使用这5个元素初始化m_wndCommandsList,其中两个是下拉菜单,另外3个是普通命令。结果
是我只看到3个命令而没有下拉菜单。有没有办法将下拉菜单添加到m_wndCommandsList?谢谢。

解决方案

嗨Davit93,


感谢您在这里发帖。


>>例如,在一个类别中,我有5个元素,并且我使用这5个元素初始化m_wndCommandsList,其中两个是下拉菜单,另外3个是普通命令。结果是我只看到3个命令而没有
下拉菜单。有没有办法将下拉菜单添加到m_wndCommandsList?谢谢。


请提供有关如何在自定义对话框中添加命令的详细信息。


如果要添加自定义命令在"自定义"对话框中,您需要处理AFX_WM_ON_RIBBON_CUSTOMIZE消息。在消息处理程序中,实例化堆栈上的CMFCRibbonCustomizePropertyPage对象。创建自定义命令列表,然后
调用AddCustomCategory将新页面添加到"自定义"对话框。


最诚挚的问候,


Sera Yu



I am creating ribbon with MFC. Default CMFCRibbonCustomizeDialog when selecting a category from "Choose commands from" in customize dialog shows only panels inside that category. SO I create my own MYRibbonCustomizeDialog which is derived from CMFCRibbonCustomizeDialog, and MYRibbonCustomizePropertyPage which is derived from CMFCRibbonCustomizePropertyPage and override  CMFCRibbonCustomizePropertyPage::OnSelendokCategoryCombo(), inside of which I initialize m_wndCommandsList, but it seems that m_wndCommandsList ignores dropdown menus. For example inside one category I have 5 elements, and I initiliaze m_wndCommandsList with that 5 elements, the two of which are dropdown menus, the other 3 are ordinary commands. The result is that I see only that 3 commands and no dropdown menu. Is there a way to also add dropdown menus to m_wndCommandsList? Thanks.

解决方案

Hi Davit93,

thanks for posting here.

>>For example inside one category I have 5 elements, and I initiliaze m_wndCommandsList with that 5 elements, the two of which are dropdown menus, the other 3 are ordinary commands. The result is that I see only that 3 commands and no dropdown menu. Is there a way to also add dropdown menus to m_wndCommandsList? Thanks.

Please provide more information about how do you add commands in your custom dialog.

If you want to add custom commands to the Customize dialog box, you need to handle the AFX_WM_ON_RIBBON_CUSTOMIZE message. In the message handler, instantiate a CMFCRibbonCustomizePropertyPage object on the stack. Create a list of custom commands, and then call AddCustomCategory to add the new page to the Customize dialog box.

Best Regards,

Sera Yu


这篇关于如何显示下拉菜单功能区自定义对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆