CCmdUI
来源:互联网 发布:文豆php培训中心深圳 编辑:程序博客网 时间:2024/06/05 16:36
对UI对象的各种操作都设计在CCmdUI成员函数中,用于拦截UPDATE_COMMAND_UI消息。现将其类说明和成员函数列于下:
Is used only within an ON_UPDATE_COMMAND_UI handler in a CCmdTarget-derived class.
class CCmdUI
Remarks
CCmdUI does not have a base class.
When a user of your application pulls down a menu, each menu item needs to know whether it should be displayed as enabled or disabled. The target of a menu command provides this information by implementing anON_UPDATE_COMMAND_UI handler. For each of the command user-interface objects in your application, use the Properties window to create a message-map entry and function prototype for each handler.
When the menu is pulled down, the framework searches for and calls each ON_UPDATE_COMMAND_UI handler, each handler calls CCmdUI member functions such asEnable and Check, and the framework then appropriately displays each menu item.
A menu item can be replaced with a control-bar button or other command user-interface object without changing the code within theON_UPDATE_COMMAND_UI handler.
The following table summarizes the effect CCmdUI's member functions have on various command user-interface items.
User-Interface Item
Enable
SetCheck
SetRadio
SetText
Menu item
Enables or disables
Checks (×) or unchecks
Checks using dot (•)
Sets item text
Toolbar button
Enables or disables
Selects, unselects, or indeterminate
Same as SetCheck
(Not applicable)
Status-bar pane
Makes text visible or invisible
Sets pop-out or normal border
Same as SetCheck
Sets pane text
Normal button in CDialogBar
Enables or disables
Checks or unchecks check box
Same as SetCheck
Sets button text
Normal control in CDialogBar
Enables or disables
(Not applicable)
(Not applicable)
Sets window text
For more on the use of this class, see How to Update User-Interface Objects.
Requirements
Header: afxwin.h
CCmdUI Members
Data Members
m_nID
The ID of the user-interface object.
m_nIndex
The index of the user-interface object.
m_pMenu
Points to the menu represented by the CCmdUI object.
m_pOther
Points to the window object that sent the notification.
m_pSubMenu
Points to the contained sub-menu represented by the CCmdUI object.
ContinueRouting
Tells the command-routing mechanism to continue routing the current message down the chain of handlers.
Enable
Enables or disables the user-interface item for this command.
SetCheck
Sets the check state of the user-interface item for this command.
SetRadio
Like the SetCheck member function, but operates on radio groups.
SetText
Sets the text for the user-interface item for this command.
- CCmdUI
- CCmdUI
- 关于CCmdUI
- CCmdUI 简介
- CCmdUI 简介
- CCmdUI类
- CCmdUI - MSDN6翻译交流
- MFC菜单操作CCmdUI
- CCmdUI工作原理及作用
- CCmdUi工作原理及作用
- MFC:CCmdUI类的功能
- MFC对话框界面中使用CCmdUI对象更新菜单状态
- MFC中 CCmdUI类是干什么用的?
- 解决 不能通过CCmdUI *pCmdUI改变对话框菜单状态 的问题
- 解决“不能通过CCmdUI *pCmdUI改变对话框菜单状态”的问题
- MFC CCmdUI<控制菜单,工具栏,状态条,CDialogBar按钮,点击状态类>
- win7下安装非关系型数据库MongoDB
- HttpApplication的生命周期
- thift源码研究-TProcessor类体系
- SQL SERVER 2000 存储过程写法
- Android高级开发第五讲--API之Content Providers
- CCmdUI
- HttpModule和HttpHandler
- 差分信号的理解(MIPI) .
- 文件批处理
- android音频口通信(二)——2FSK信号解调
- 8051 - 在keil中添加STC型号的3种方法
- 安装驱动的inf文件资料
- Android高级开发第四讲--API之Intents and Intent Filters
- 重新出发