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 » Dynamic menus reflected in the customization dialog Collapse All
Subject Author Date
David Modigliani Nov 13, 2003 - 9:42 AM

I currently handle the OnExtMenuPrepare registered message to alter my menu dynamically. The current menu resource has only one item in the popup. I insert more items int the popup on the fly. I use the command manager CmdSetup routine to add the new command. I see the items in the menu as I would expect. However, when the customization dialog is displayed the list displays only the one item with the original text. Not the item’s text that I changed it to and the other items I have created are not displayed either. Is there a way to do this? Any help/suggestions would be appreciated.
Thanks

Technical Support Nov 14, 2003 - 4:04 AM

Dear David,

The OnExtMenuPrepare handler is only called if your application is not in the Customize mode. This is absolutely correct behavior of the popup menu. For example, if you insert a paint-brush bitmap into MS Word and then select object, you may note that the Edit/Object menu (in your Word application) contains dynamically constructed items corresponding to bitmap operations. Then if unselect the bitmap by selecting, for example, a piece of text in the document, the Edit/Object menu will become just a disabled item.

Please note: the MS Word’s Edit/Object dynamic submenu is not accessible in the customize mode at all.

David Modigliani Nov 14, 2003 - 5:28 AM

I am creating menus dynamically in my code. I would like to have these items appear in the cusomization dialog when the user wants to customize the menu. I am having the very same issue as a previous post (Guillaume Provost Aug 21, 2003). Any help would be appreciated.
Thanks

Technical Support Nov 14, 2003 - 6:57 AM

Dear David,

To add customizable commands, you should register them in the command manager first. Then you may insert them into any command category that are displayed in the Customize dialog.

To register a command in the customize category, just invoke:

UINT nCmdID = . . .
CExtCustomizeSite::CategoryUpdate(
		"Category name", // New category created automatically
		& nCmdID,
		1
		);

David Modigliani Nov 17, 2003 - 5:21 AM

I have one item in the menu resource. I implement ItemInsertCommand to create the new additional menu items. Then call CategoryUpdate with an array of command ids which I just added. The menus are visible but in the customization dialog only the first item is displayed.
When i pull down the menu item while customizing the menus. The menus I had just created with ItemInsertCommand are not visible. I have tried updating the CustomizedTreeNode but I am seeing some odd behavior. Any help/assistance would be appreciated.
Thanks

Technical Support Nov 18, 2003 - 2:51 AM

We sent you an e-mail with the suggestion to use the g_CmdManager->CmdAllocPtr() method in your dynamic menu construction procedure. It fixes the problem.