菜单类 More...
#include <SMenu.h>
Public Member Functions | |
| SMenu (const SMenu &src) | |
| 复制构造函数 | |
| SMenu (HMENU hMenu=0) | |
| 构造函数 | |
| ~SMenu (void) | |
| 析构函数 | |
| BOOL | Attach (HMENU hMenu) OVERRIDE |
| 附加菜单句柄 | |
| HMENU | Detach () OVERRIDE |
| 分离菜单句柄 | |
| HMENU | GetHMenu () SCONST OVERRIDE |
| 获取菜单句柄 | |
| BOOL | LoadMenu (LPCTSTR resId) OVERRIDE |
| 加载菜单资源 | |
| BOOL | LoadMenuU8 (LPCSTR resId) OVERRIDE |
| 加载菜单资源(UTF-8) | |
| BOOL | LoadMenu2 (IXmlNode *xmlMenu) OVERRIDE |
| 加载菜单资源(XML) | |
| void | SetIconSkin (ISkinObj *icons) OVERRIDE |
| 设置菜单图标皮肤 | |
| BOOL | InsertMenu (UINT uPosition, UINT uFlags, UINT_PTR nIDNewItem, LPCTSTR strText, int iIcon=-1, HICON hIcon=0) OVERRIDE |
| 插入菜单项 | |
| BOOL | AppendMenu (UINT uFlags, UINT_PTR uIDNewItem, LPCTSTR lpNewItem, int iIcon=-1, HICON hIcon=0) OVERRIDE |
| 追加菜单项 | |
| BOOL | CheckMenuItem (UINT uIdCheckItem, UINT uCheck) OVERRIDE |
| 检查菜单项 | |
| BOOL | CheckMenuRadioItem (UINT idFirst, UINT idLast, UINT idCheck, UINT uFlags) OVERRIDE |
| 检查菜单项(单选按钮) | |
| BOOL | DeleteMenu (UINT uPosition, UINT uFlags) OVERRIDE |
| 删除菜单项 | |
| UINT | TrackPopupMenu (UINT uFlags, int x, int y, HWND hWnd, LPCRECT prcRect=NULL, int nScale=100) OVERRIDE |
| 跟踪弹出菜单 | |
| void | DestroyMenu () OVERRIDE |
| 销毁菜单 | |
| BOOL | ModifyMenuString (UINT uPosition, UINT uFlags, LPCTSTR lpItemString) OVERRIDE |
| 修改菜单项字符串 | |
| BOOL | SetMenuUserData (UINT uPosition, UINT uFlags, ULONG_PTR ulUserData) OVERRIDE |
| 设置菜单项用户数据 | |
| ULONG_PTR | GetMenuUserData (UINT uPosition, UINT uFlags) OVERRIDE |
| 获取菜单项用户数据 | |
| DWORD | GetContextHelpId () SCONST OVERRIDE |
| 获取上下文帮助ID | |
| void | SetContextHelpId (DWORD dwId) OVERRIDE |
| 设置上下文帮助ID | |
| HMENU | GetSubMenu (int nPos) OVERRIDE |
| 获取子菜单 | |
| BOOL | GetMenuString (UINT uPosition, UINT uFlags, IStringT *lpItemString) OVERRIDE |
| 获取菜单项字符串 | |
Public Member Functions inherited from TObjRefImpl< IMenu > | |
| TObjRefImpl () | |
| Constructor that initializes the reference count to 1. | |
| virtual | ~TObjRefImpl () |
| Virtual destructor. | |
| long | AddRef () override |
| Increments the reference count. | |
| long | Release () override |
| Decrements the reference count and deletes the object if the count reaches zero. | |
| void | OnFinalRelease () override |
| Deletes the object. | |
Public Attributes | |
| HMENU | m_hMenu |
Protected Member Functions | |
| void | UpdateScale (int nScale) |
| 更新缩放比例 | |
| void | BuildMenu (HMENU menuPopup, SXmlNode xmlNode) |
| 构建菜单 | |
| void | InitMenuItemData (SMenuItemData *itemInfo, const SStringW &strText) |
| 初始化菜单项数据 | |
| void | FreeMenuItemData (HMENU hMemu) |
| 释放菜单项数据 | |
| SMenuAttr * | GetMenuAttr (HMENU hMenu) const |
| 获取菜单属性对象指针 | |
| void | SetMenuAttr (HMENU hMenu, SMenuAttr *pMenuAttr) const |
| 设置菜单属性对象指针 | |
Protected Attributes | |
| bool | m_bAttached |
| SAutoRefPtr< ISkinObj > | m_icons |
Protected Attributes inherited from TObjRefImpl< IMenu > | |
| LONG | m_cRef |
| Reference count. | |
| SMenu::SMenu | ( | const SMenu & | src | ) |
| SMenu::SMenu | ( | HMENU | hMenu = 0 | ) |
| BOOL SMenu::AppendMenu | ( | UINT | uFlags, |
| UINT_PTR | uIDNewItem, | ||
| LPCTSTR | lpNewItem, | ||
| int | iIcon = -1, | ||
| HICON | hIcon = 0 ) |
| BOOL SMenu::Attach | ( | HMENU | hMenu | ) |
|
protected |
| BOOL SMenu::CheckMenuItem | ( | UINT | uIdCheckItem, |
| UINT | uCheck ) |
| BOOL SMenu::CheckMenuRadioItem | ( | UINT | idFirst, |
| UINT | idLast, | ||
| UINT | idCheck, | ||
| UINT | uFlags ) |
| BOOL SMenu::DeleteMenu | ( | UINT | uPosition, |
| UINT | uFlags ) |
|
protected |
| DWORD SMenu::GetContextHelpId | ( | ) |
|
protected |
| BOOL SMenu::GetMenuString | ( | UINT | uPosition, |
| UINT | uFlags, | ||
| IStringT * | lpItemString ) |
| ULONG_PTR SMenu::GetMenuUserData | ( | UINT | uPosition, |
| UINT | uFlags ) |
| HMENU SMenu::GetSubMenu | ( | int | nPos | ) |
|
protected |
| BOOL SMenu::InsertMenu | ( | UINT | uPosition, |
| UINT | uFlags, | ||
| UINT_PTR | nIDNewItem, | ||
| LPCTSTR | strText, | ||
| int | iIcon = -1, | ||
| HICON | hIcon = 0 ) |
| BOOL SMenu::LoadMenu | ( | LPCTSTR | resId | ) |
| BOOL SMenu::LoadMenu2 | ( | IXmlNode * | xmlMenu | ) |
| BOOL SMenu::LoadMenuU8 | ( | LPCSTR | resId | ) |
| BOOL SMenu::ModifyMenuString | ( | UINT | uPosition, |
| UINT | uFlags, | ||
| LPCTSTR | lpItemString ) |
| void SMenu::SetContextHelpId | ( | DWORD | dwId | ) |
| void SMenu::SetIconSkin | ( | ISkinObj * | icons | ) |
|
protected |
| BOOL SMenu::SetMenuUserData | ( | UINT | uPosition, |
| UINT | uFlags, | ||
| ULONG_PTR | ulUserData ) |
| UINT SMenu::TrackPopupMenu | ( | UINT | uFlags, |
| int | x, | ||
| int | y, | ||
| HWND | hWnd, | ||
| LPCRECT | prcRect = NULL, | ||
| int | nScale = 100 ) |
|
protected |
|
protected |