28.10.2006, 18:22 | #1 |
Участник
|
Axapta Lessons: Add menu options to the Add-Ins submenu
Источник: http://axapta-lessons-learned.blogsp...s-submenu.html
============== When we right-click on an object in the AOT a shortcut menu opens. This shortcut menu is called Context Menu and has an Add-Ins menu where we can find various development tools. Most of the development tools that we can find under Tools, option Development tools are available under the Add-Ins menu. Let us have a look at such a context menu for the table DlvTerm. Open the AOT. Open the node Data Dictionary. Open the node Tables and locate the table DlvTerm. Right-click on the table object DlvTerm and select Add-Ins from the shortcut menu. The menu items on the Add-Ins submenu are defined in the Menu sysContextMenu. All items in the Menu sysContextMenu are automatically added to the Add-Ins submenu. Standard the Add-Ins submenu contains different items depending on the object that is selected. If we open the Add-Ins submenu for the field Code on the table DlvTerm, we will see that the next items are not available: * Developer Documentation * Table definitions * Table browser * Auto-report * Visual MorphXplorer * Application Hierarchy Tree * Source Code Titlecase Update When we select the submenu Add-Ins from the context menu the method verifyItem on the class sysContextMenu is automatically called. The method verifies for each item in the Menu sysContextMenu whether it should become available in the current context. The method verifyItem(identifiername MenuItemName, MenuItemType MenuItemType) takes the name of the menu item and the menu item type as parameters and must return 0 (zero) if the item should not be available. The method verifyItem disables the menu item Table browser when the object is not of type Table. Note: When we add our own menu items to the Add-Ins submenu we will have to add our own logic to the method verifyItem in case we want to disable the availability of a menu item in certain contexts. We can add our own tool to the Add-ins menu as follows: 1. Create a menu item for the object. 2. Use a drag-and-drop operation to move the menu item to the menu sysContextMenu. Let us look at an example: 1. Created menu item ContextMenuTest (Label Context Menu Test). It is an empty menu item, meaning no Object is specified. 2. Drag-and-drop the new menu item to the menu sysContextMenu. Now the menu sysContextMenu looks as follows: 3. Check how this looks for the table DlvTerm [End of Lesson] ============== Источник: http://axapta-lessons-learned.blogsp...s-submenu.html |
|