![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Altering Module Menu bar dynamically Topic Summary: How can we activate and deactivate menu items on the fly? Created On: 17-Oct-2008 00:27 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Ultimately I'm trying to add a single item to the menu bar for the Module window, and I'd like to populate submenus and so on based on the User's group memberships. I've seen other threads on this, but I still have some questions:
1) If I add a basic menu set (set of sub menus and menu items) using the "folder" method (use createMenu() and pass it a folder structure rather than an individual DXL file) that are for all users, then wish to add in a few additional menu items using the "file" method (createMenu() that is passed a single DXL file), how can I do that? In other words, after a block of code has been run to create a menu, how can I go in to that menu to add or delete items? 2) Some native DOORS menu items are grayed out and reactivated depending on things like edit mode (say, "Lock Section" depends on being in Sharable Edit mode). How is this done? I'd like to gray out some my custom tools and even some native DOORS tools and I'm not sure how. What I've learned so far is that to modify native DOORS menus, I have to modify formal.dxl (\lib\dxl\config). I also see how I can add menu items by setting up a set of callback "mapping functions" in lib\dxl\startupFiles and then putting other files that set up the menus in \lib\dxl\config\formalFiles. What other tricks are there? How does telelogic pull it off to change menu item status dynamically? Thanks Jason |
|
![]() |
|
![]() |
|
I think the trick is to create all the menu items, then grey out the inappropriate ones. I've done this for menu items that should only be run from particular modules using the attached code.
Note that the first function (ProjectActive) lives in a *.dxl file in the "config/baseWindowCallbackFiles" folder, and the other function and its call live in a *.inc file in folder "config/baseWindowMenuFiles". Maybe that will help you... Paul ------------------------- Paul dot Tiplady at TRW dot com TRW Automotive |
|
![]() |
|
![]() |
|
Thanks! After seeing your post, and talking to some folks at the Telelogic Innovation 2008 conference, it seems like Module menus can only be updated (add, remove, gray out, un-gray out, etc) when the Module open state is changed (opened initially, changed from read only to edit, etc). The implication is that a DXL script couldn't be written to, say, change menu items real time. For example, if I wrote a GUI with a checklist of menu items for the user to select which menu items he'd like to see, after he made his choices, there would be no way to apply those choices without changing the module edit state. (or closes then re-opens the module)
This raises the question: some trigger must be watching for module edit mode changes and then calling some menu re-draw function every time it's triggered. Does anyone know what that redraw function is? If so, then scripts could be written to change menu items real time. |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Altering Module Menu bar dynamically
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.