如何在多文档界面应用程序中正确使用cricheditctrl [英] How do I use cricheditctrl correctly in a multiple document interface application

查看:63
本文介绍了如何在多文档界面应用程序中正确使用cricheditctrl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要两个MultiDoc模板,一个带有Doc / View用于曲线的图形显示(使用CChildFrm用于框架),另一个带有Doc / View用于文本编辑(也使用CChildFrm)。使用CEditView作为视图的RUNTIME_CLASS是不合适的,因为我想编辑超过1 MB的文本。

图形显示以及基于CEditView的简单文本编辑器运行良好我可以切换两个模板之间。



我尝试了什么:



我尝试过在CView派生类中使用CRichEditCtrl。标准编辑器功能,如复制,剪切,粘贴,工作良好,还可以从文件中读取和写入数据,但只使用View类中的方法,而Document类中没有任何内容。查找,搜索或全选都不起作用。此外,焦点不会立即在CRichEditCtrl上设置,窗口的标题会更新延迟。

I want to have two MultiDoc templates, one with a Doc/View for graphical display of curves (using CChildFrm for the frame) , and one with a Doc/View for text editing (also using CChildFrm). The use of CEditView as RUNTIME_CLASS for the view is unsufficient as I want to edit text with more than 1 MB.
The graphical display as well as a simple text editor basing on CEditView work well and I can switch between both templates.

What I have tried:

I tried to use a CRichEditCtrl in a CView-derived class. Standard editor functions like Copy, Cut, Paste, work well, also read and write of data from and in a file, but only using methods in the View class, nothing in the Document class. Find, Search or Select All do not work. Moreover, the focus is not set instantanously on the CRichEditCtrl and the title of the window is updated with delay.

推荐答案

为什么不使用CRichEditView类 [ ^ ]?它与 CRichEditDoc [ ^ ]和 CRichEditCntrItem [ ^ ],在MFC的文档视图体系结构的上下文中提供丰富的编辑控件的功能。

它将为您提供开箱即用的所有Rich Edit控件。
Why don't you use the CRichEditView Class[^]? It together with CRichEditDoc[^] and CRichEditCntrItem[^], provides the functionality of the rich edit control within the context of MFC's document view architecture.
It will provide you with all Rich Edit controls out of the box.


这篇关于如何在多文档界面应用程序中正确使用cricheditctrl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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