在没有显示视图的情况下打开/未打开文档时出现不同的菜单问题? [英] Issue on different Menues when Document is opened / not opened without displaying view?

查看:83
本文介绍了在没有显示视图的情况下打开/未打开文档时出现不同的菜单问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Project Style"Visual Studio"创建了一个应用程序。

I have created an application with Project Style "Visual Studio".

我有一个"资源管理器"窗格"管理我的文档和视图(例如VS2015本身的"解决方案资源管理器")。

I have an "Explorer Pane" to manage my documents and views (like "Solution Explorer" in VS2015 itself).

我希望有与VS2015类似的行为。只要没有打开解决方案(在我的情况下:"工作区"),就会显示一个基本的菜单。打开解决方案时,应显示不同的菜单。

I want to have a similar behaviour as VS2015. As long no solution is opened (in my case: "Workspace"), there is displayed a basic menue. When solution is opened, a different menue should be displayed.

我的工作区表示为CDocument,因为我已经创建了一个doc模板。

My workspace is represented as CDocument, for whích I have created a doc template.

使用参数bMakeVisible = false的OpenDocumentFile()打开工作空间。工作区本身不应显示任何视图。

The workspace is opened with OpenDocumentFile() with parameter bMakeVisible = false. No view should be displayed for workspace itself.

但是,只要没有显示视图,菜单就不会切换。我该怎么办呢?

But, as long no view is displayed, the menue is not switching. How can I manage this?

非常感谢

Richard

推荐答案

一次只能打开一个文档,还是支持多个文档?如果多个,那么他们都会使用相同的文档模板吗?如果这两个(使用相同文档模板的多个文档)都为真,则描述MDI
体系结构。开发人员经常将MDI用于多个窗口,但MDI不是为此而设计的,但如果您有多个文档使用相同的模板,那么它可能是MDI的理想用途。 MDI支持切换菜单等内容。

Will there be only one document open at a time or will you support multiple documents? If multiple then will they all use the same document template? If both of those (multiple documents using the same document template) are true then that describes a MDI architecture. Developers often use MDI for multiple windows but MDI is not designed for that but if you have multiple documents using the same template then it is probably an ideal use of MDI. MDI has support of things like switching the menu.

如果您想一次只支持一个文档,请不要使用MDI。还有其他解决方案,但我需要参考文档来提醒我MFC是如何工作的。几年前我做过它,但已经有几年了。

If you want to support only one document at a time then don't use MDI. There are other solutions available but I need to refer to the documentation to remind me how MFC works. I did work with it a few years ago but it has been a few years.


这篇关于在没有显示视图的情况下打开/未打开文档时出现不同的菜单问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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