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 » User-defined customisation. Collapse All
Subject Author Date
Robert Webb Jul 7, 2009 - 2:16 AM

Hi,


I’m somewhat confused about how to add extra user-customisation capabilities.


Our software loads user-defined menus from our own file format.  Before using Prof-UIS a user could create their own menu file, load it into the software to see a list of available menus, and drag these menus into the menubar.  I’m trying to make this work again using Prof-UIS.


I’m over-riding OnCreateCustomizeForm() and have added our own tab, with a list control that shows user-defined menu names.  These are not menu items, but whole menus.  I’m using g_CmdManager->CmdSetup() to add user-commands to the manager, and creating a tree of CExtCustomizeCmdTreeNode nodes to represent the menu structure.  Am I on the right track?  The following might be a problem: I am only using CmdSetup() for leaf nodes in the menu structure, ie menu items that actually perform a function, rather than just being submenus.


I then fill the list control with items from the CExtCustomizeCmdTreeNode tree.


The problem now is that when I drag an item from the list, it immediately hits an assertion because the CExtCustomizeCmdTreeNode nodes representing a menu has ID zero.  This is because it’s not a command, but rather a submenu with command nodes under it.  I thought it didn’t matter what the ID was for menu items which opened submenus?  They are not commands afterall.  Do I need to give each one a unique ID as well?  Is there a way to avoid that?


Thanks,

Rob.

Technical Support Jul 7, 2009 - 12:26 PM

The popup submenu items are also based on command tree nodes in the case of customizable menus. These command tree nodes must have unique command identifiers. These unique command identifiers are required for customization subsystem because it supports resetting any sub menu tree. The unique command identifiers allow you to find the root node of any sub menu in the initial command tree of toolbar or menu bar. It’s not possible to avoid command identifier allocations for popup sub menu items. The command tree nodes of popup sub menu items should be marked with the __ECTN_DYNAMIC_POPUP style and appropriate command descriptions in the command manager should be marked with the CExtCmdItem::StateSetDynamicPopup() method.