{$cfg_webname}
主页 > 外文翻译 > 计算机翻译 >

菜单-键盘-加速键-多信息编辑控件和属性表

来源:wenku163.com  资料编号:WK1635532 资料等级:★★★★★ %E8%B5%84%E6%96%99%E7%BC%96%E5%8F%B7%EF%BC%9AWK1635532
资料介绍

中文翻译
菜单、键盘、加速键、多信息编辑控件和属性表 
 迄今为止,在本书中所有的例子中,鼠标单击都会触发大多数程序活动。即使菜单选择更合适,你也可能更愿意使用鼠标单击,因为鼠标单击消息的处理比较简单,而且,你可以直接在MFC库6.0版本视图窗口内进行。如果你想让用户从菜单中选择一个命令之后出发程序活动,就必须首先熟悉其他应用程序框架元素。
 本章将重点放在菜单和命令的传递路径结构上,而且我们还将介绍框架和文档,解释这些新应用程序框架元素和已有的类似视图元素之间的关系。你还将使用ClassWizard将文档和视图元素链向菜单项。你还将学会如何使用特殊的更新命令用户界面(UI)成员函数来检查和禁止使用菜单项,还将学习使用键盘加速键作为快捷键。
 你可能对圆和对话框感到厌烦了,所以,我们还将介绍两个新的MFC创建块。多信息编辑通用控件可以向应用程序添加强大的文本编辑功能。属性表是设置编辑选项的理想选择。
主框架窗口和文档类
 迄今为止,你一直在使用一个视图窗口,就好象它是这个应用程序的唯一窗口似的。在SDI应用程序中,视图窗口位于另一个窗口(应用程序的主框架窗口)的旁边。主框架窗口有标题栏和菜单栏。各种子窗口(包括工具栏窗口、视图窗口和状态栏窗口)占据了主框架窗口的客户区。通过从框架向视图传递消息,应用程序框架控制框架和视图之间的交互。
 让我们再看一看有AppWizard生成的所有的工程文件。MainFrm.h和MainFrm.cpp文件包含有应用程序主框架窗口类的代码,它是从类CFramWnd中派生出来的。Ex13aDoc.h和ex13aDoc.cpp这样的文件包含应用程序文档类的代码,它是从CDocument中派生出来的。在本章中,你将开始使用MFC文档类。你将了解到,每个视图对象都附加有一个文档对象,并且,该视图的继承GetDocument成员函数返回指向该对象的一个指针。在第15章中,我们还将介绍框架窗口,在16章中,你将了解到有关文档交互的更多知识。

英文原文 (毕业设计)
Menus, Keyboard Accelerators, the Rich Edit Control, and Property Sheets
In all the book's examples to this point, mouse clicks have triggered most program activity. Even though menu selections might have been more appropriate, you've used mouse clicks because mouse-click messages are handled simply and directly within the Microsoft Foundation Class (MFC) Library version 6.0 view window. If you want program activity to be triggered when the user chooses a command from a menu, you must first become familiar with the other application framework elements.
This chapter concentrates on menus and the command routing architecture. Along the way, we introduce frames and documents, explaining the relationships between these new application framework elements and the already familiar view element. You'll use the menu editor to lay out a menu visually, and you'll use ClassWizard to link document and view member functions to menu items. You'll learn how to use special update command user interface (UI) member functions to check and disable menu items, and you'll see how to use keyboard accelerators as menu shortcut keys.
Because you're probably tired of circles and dialogs, next you'll examine two new MFC building blocks. The rich edit common control can add powerful text editing features to your application. Property sheets are ideal for setting edit options.
The Main Frame Window and Document Classes
全文 10000 字

推荐资料