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 General Discussion » how to register command id Collapse All
Subject Author Date
liu yj Mar 3, 2004 - 7:35 PM

hi, i want to dynamic add menu item use


nReplacePos =
   pPopup->ItemFindPosForCmdID(ID_OBJECT_FILLCOLOR);
   pPopup->ItemInsert(ID_MYITEM,nReplacePos+1);


but i dont know how to register ID_MYITEM


i use as follow:


g_CmdManager->UpdateFromMenu(pApp->m_pszProfileName,ID_MYITEM);


but it cant work


please help me


 

Technical Support Mar 4, 2004 - 10:32 AM

Dear Liu,

You should allocate your dynamic commands before using them. Just invoke this:

CExtCmdItem * pMyDynamicCommand =  

   g_CmdManager->CmdAllocPtr( 

      "profile name", 

      nCmdID  

   );

If nCmdID is equal to zero, then command manager finds a new identifier automatically. If nCmdID is not zero and unused, then pMyDynamicCommand is not NULL and describes your new dynamic command. If nCmdID identifier is already used, then pMyDynamicCommand is set to NULL.

When pMyDynamicCommand is successfully allocated, you can set up its properties:
pMyDynamicCommand->m_sMenuText = _T("Text in menu"); 

pMyDynamicCommand->m_sToolbarText = _T("Text in bar");  

pMyDynamicCommand->m_sTipTool = _T("Tooltip");

pMyDynamicCommand->m_sTipStatus = _T("Balloon tip");