| 995 | } |
| 996 | |
| 997 | ResultType GuiType::SetMenu(ExprTokenType &aParam) |
| 998 | { |
| 999 | UserMenu *menu = NULL; |
| 1000 | if (!TokenIsEmptyString(aParam)) |
| 1001 | { |
| 1002 | menu = dynamic_cast<UserMenu *>(TokenToObject(aParam)); |
| 1003 | if (!menu || menu->mMenuType != MENU_TYPE_BAR) |
| 1004 | return ResultToken().TypeError(_T("MenuBar"), aParam); |
| 1005 | menu->CreateHandle(); // Ensure the menu bar physically exists. |
| 1006 | menu->AddRef(); |
| 1007 | } |
| 1008 | if (mMenu) |
| 1009 | mMenu->Release(); |
| 1010 | mMenu = menu; |
| 1011 | ::SetMenu(mHwnd, menu ? menu->mMenu : NULL); // Add or remove the menu. |
| 1012 | if (menu) // v1.1.04: Keyboard accelerators. |
| 1013 | UpdateAccelerators(*menu); |
| 1014 | else |
| 1015 | RemoveAccelerators(); |
| 1016 | return OK; |
| 1017 | } |
| 1018 | |
| 1019 | |
| 1020 | ResultType GuiType::ControlSetName(GuiControlType &aControl, LPTSTR aName) |
nothing calls this directly
no test coverage detected