如何在窗口菜单中显示可用窗口

发布于 2024-07-30 12:15:01 字数 371 浏览 5 评论 0原文

我有一个 MFC MDI 应用程序,最近从 VS2003 移植到 VS2008,同时从 Stingray Objective Studio 2006 v2 迁移到 v10.1。 在我的应用程序的早期版本中,如果我打开了多个视图,窗口菜单将由可用视图的枚举列表填充,例如 1 MyViewA2 MyViewB 等等...如果我有大量视图,我还会获得一个Windows... 菜单选项来允许我选择一个视图。 这种情况不再发生,这破坏了我的一些 GUI 级回归测试。 我的猜测是,此功能是由 CMDIFrameWnd 或 SECMDIFrameWnd 实现的,但我在文档中找不到对其的引用。 有谁知道我如何才能恢复此功能。

I have a MFC MDI application that I've recently ported from VS2003 to VS2008, and at the same time moved from Stingray Objective Studio 2006 v2 to v10.1. On the previous versions of my application, if I had more than one view open, the Window menu would be populated by an enumerated list of available views, e.g. 1 MyViewA, 2 MyViewB etc... If I had a large number of views, I would also get a Windows... menu option to allow me to select a view. This no longer happens, which is breaking some of my GUI level regression tests. My guess is that this functionality was implemented by either CMDIFrameWnd or SECMDIFrameWnd but I couldn't find a reference to it in the documentation. Does anyone know how I can get this functionality back.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沩ん囻菔务 2024-08-06 12:15:01

我要做的第一件事是使用 ClassWizard 创建一个新的 MDI 应用程序,并检查您缺少的功能是否存在。 如果是这样,请四处看看,看看您是否能看出有什么不同。 一个值得一看的地方可能是主菜单的菜单资源。

如果没有内置功能可以提供您所需的功能,您可以使用以下伪代码动态构建菜单:

foreach registered CDocumentTemplate 
    foreach document
        foreach view
        {
            if (numberOfWindowMenuItems < 5)
            {
                Add menu item
            }
            else
            {
                Add "Windows..." menu item
                break all loops;
            }

First thing I'd do is create a new MDI application with the ClassWizard and check if the functionality you're missing is present. If so, poke around and see if you can tell what's different. One place to look may be the menu resource for the main menu.

If there is no in-built functionality to provide what you need, you can dynamically build the menu with the following pseudocode:

foreach registered CDocumentTemplate 
    foreach document
        foreach view
        {
            if (numberOfWindowMenuItems < 5)
            {
                Add menu item
            }
            else
            {
                Add "Windows..." menu item
                break all loops;
            }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文