 1-Mar-2006 13:17
|
Joachim Hochwarth

Posts: 11
Joined: 1-Mar-2006
|
Hello -
I am trying to insert a menu from a *.dxl and DOORS just seems to ignore it. I inserted the following in formal.dxl ...
int showCustomMenu() { return menuAvailable_ }
void createCustomMenu() { createMenu(showCustomMenu, "Custom DXL", 'D', "C:\\DXLs\\CustomMenuItems.dxl") }
... plus the call to createCustomMenu(). The CustomMenuItems.dxl looks like ...
string specificdirstr = "..." // Path to Location on Network
createMenu(alwaysOn, "DummyMenu", 'D', null) createItem(alwaysOn, "DummyItem", null, null, modKeyCtrl, null, null, null, null, specificdirstr "/DummyDXL.dxl") end menu
Why does DOORS not show that menu? How is a *.dxl supposed to be structured to make this work? The reason why I am doing it this way, is that I do not want to show the menu if the network location is not available.
Any ideas?
Thanks, Joachim
|
|
|
 1-Mar-2006 14:23
|
Reik Schroeder

Posts: 361
Joined: 28-Jul-2003
|
Hi Joachim,
I would suggest to you to use the directory "doorshome\lib\dxl\config\formalFiles" to store the menu definitions. The files stored in that directory are automaically parsed by formal.dxl. So you need only to place your CustomMenuItems.dxl there and it should appear on next start of DOORs in every Formal Module ...
BTW. you could place the same file into "doorshome/\lib\dxl\config\formalPopupFiles" to create the same entries in context menu.
I hope this will work for you ...
The great advantage of this feature is, that you do not need to modifify any original DOORs file
Greetings
Reik Schröder
-------------------------
Evosoft GmbH for Siemens Industry Sector
Berlin, Germany
|
|
|
 1-Mar-2006 15:36
|
Joachim Hochwarth

Posts: 11
Joined: 1-Mar-2006
|
Hello -
I like the idea of not having to tweak the formal.dxl ... so I moved my stuff to that location. The problem, however, is still there ... how can I make the form of createMenu() work when I want to use a *.dxl file?
The ... createMenu(showCustomMenu, "Custom DXL", 'D', "NETWORKPATH\\CustomMenuItems.dxl") ... does not even seem to call the callback function showCustomMenu. I also put some intentional syntax errors in the CustomMenuItems.dxl but that file never gets executed because I don't get any error messages.
I want the showCustomMenu to check whether the file CustomMenuItems.dxl is available (because it is on the network) and only then show the menu.
Why does't this work?
Thanks, Joachim
|
|
|
 1-Mar-2006 22:19
|
Louie Landale

Posts: 2070
Joined: 12-Sep-2002
|
I've never done this sort of modification, but I notice that the "createMenu" command expects a window's directory (folder) as input, not the name of some DXL script. The DXL script would go inside that folder and I'm pretty sure that the folder would require a *.idx and *.hlp files (as per "The DXL Library and Addins menus" DXL chapter) along with the DXL file. You could put multiple DXLs there in, change them at will, and don't have to modify your Formal.dxl every time your deployment changes.
- Louie
|
|
|
 1-Mar-2006 22:36
|
Louie Landale

Posts: 2070
Joined: 12-Sep-2002
|
And, of course, the DXL needs to be properly formatted, with a single comment line followed by a single comment block near the top, such as:
// NameOfDXL.dxl - One phrase summary of DXL
/*
A couple-three paragraphs describing what the DXL will do
*/
The comment line and block appear when you go to Tools >DXL Library.. from a formal module.
- Louie
|
|
|
 2-Mar-2006 09:33
|
Reik Schroeder

Posts: 361
Joined: 28-Jul-2003
|
Hello Joachim,
does the menu item appear in formal modules?
I tried it with DOORs 7.1 and it works fine - all our menues are created in that way.
We are checking the name of Module and some Group memberships of user to change the menu dynamically.
Your CustomMenuItems.dxl could be adapted a little bit, to hide the menu if the file does not exist.
Then you have to place this file as it is without the call of createMenu function!
Did you tried to use a Windows network path, like "\\server\drive\path", or did you mapped the network drive to a local drive letter before? May that could be a problem?
I hope this will help you ...
Greetings
Reik
-------------------------
Evosoft GmbH for Siemens Industry Sector
Berlin, Germany
Edited: 2-Mar-2006 at 10:15 by Reik Schroeder
|
|
|
 2-Mar-2006 11:00
|
Joachim Hochwarth

Posts: 11
Joined: 1-Mar-2006
|
Hello Louie -
Thanks for you reply. There actually is a second form of the createMenu() function (at least in 7.1) that takes a dxlFile rather than a menu plus the callback function: createMenu(int mappingFunction(),string label,char mnemonic,string dxlFile)
That is the function I am having trouble with.
Thanks, Joachim
|
|
|
 2-Mar-2006 11:15
|
Joachim Hochwarth

Posts: 11
Joined: 1-Mar-2006
|
Hello Reik -
Thanks a lot for your reply and code. I have been able to insert a menu item with createItem() and checking whether the *.dxl existed but I was trying to create the entire menu in a *.dxl file since the contents could change (adding new sub-menus etc) and I want this to be updated automatically for users.
I also tried to locate the *.dxl containing the menu locally and I also tried all kinds of different ways to specify that path.
I attached the entire code to this message.
If I do a ... createMenu(alwaysOn, "DXLs INCLUDE", 'I', null) #include <C:\DXLTest\Dummy.dxl> end menu ... it will work just fine
Thanks again, Joachim
|
|