Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » How to change accelerator text in menu? Collapse All
Subject Author Date
Stephan Finkler Mar 10, 2005 - 10:01 AM

I would like to change the accelerator text in menu.
I do something like:

CExtCustomizeSite::CCmdMenuInfo *pCmdMenuInfo = CExtCustomizeSite::MenuInfoGetAt(nMenuInfoIdx) ;
CExtCustomizeCmdTreeNode *pMenuRootNode = pCmdMenuInfo->GetNode(bInitial);
..
..
while(pNode) { // all nodes of registered menus

CExtCmdItem *pCmdItem = pProfile->CmdGetPtr( pNode->GetCmdID() );

pCmdItem->m_sMenuText = TextItems.m_sMenuText;
pCmdItem->m_sToolbarText = TextItems.m_sMenuText;
pCmdItem->m_sTipTool = TextItems.m_sTipTool;
pCmdItem->m_sTipStatus = TextItems.m_sTipStatus;
pCmdItem->m_sAccelText = TextItems.m_sAccelText; // new Text e.g. _T("Strg+P");
pNode->AssignCmdProps( pCmdItem );

nextNode();
}

m_wndMenuBar.UpdateMenuBar();

Everything is fine, but the accelerator text doesn’t change in the menu
e.g. "Print Ctrl+P" should be "Print Strg+P"

Any idea???

Technical Support Mar 10, 2005 - 11:27 AM

Please take a look at the CExtCustomizeSite::OnFormatCmdAccelText() virtual method. It fills a string object with the description of key combination(s). You may override this method and localize your accelerators. You don’t have to access command tree node objects nor command item objects in the command manager.