![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Not launching multiple dialogs... Topic Summary: Created On: 5-Jul-2004 21:18 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I am wondering what would be the way to avoid launching multiple dialogs if the same command from the menu is executed more than once.
Here is part of my code: // Create the dialog box DB MyDB = create(m, "My Dialog", styleCentered) // Pressing "Run" button on "My Dialog" dialog will start the work... void runMyDialog(DB win) { // some processing code here ... } // Create the "Run" button and associate it with the runMyDialog() function apply(MyDB, "&Run", runMyDialog) // Show the dialog show(MyDB) Each time I select a command from menu in DOORS, it launches "My Dialog" even when it is already open. I would like it not to launch multiple "My Dialog" dialogs if one is already open. Thanks. |
|
![]() |
|
![]() |
|
I tried using your suggestion but it doesn't seem to be working.
I added the check: if (!showing(MyDB)) { show(MyDB) } Still, if the dialog is already open and I select the menu command again it launches another dialog. Any other ideas? |
|
![]() |
|
![]() |
|
What you are asking for is exactly how some of the built-in windows work.
For example, Select object properties dialog from one module and then select it again from another module and the same dialog is updated with fresh information. You can get a handle on built-in windows using functions provided, see DOORS Buit-in windows in the help. Only some of the windows are documented and I have no idea what the internal data types or mechanisms are. If you want to check for the dialog using showing(DB) you will need to store the handle somewhere globally (i.e. in the top context). Alternatively, you could use block() instead of show() when displaying the dialog, but this prevents any other window being selected while the dialog is displayed. ------------------------- Tony Goodman http://www.smartdxl.com |
|
![]() |
|
![]() |
|
Checking "showing(db)" won't work since the dialog definition handle is local to the execution of the script.
Don't know of any way of querying then names of currently open windows from DXL. Your script could set an Environment Variable using the session number of the module: setenv("EnvironForMyScript", session()"") when it fires up, then clears the that variable when it closes down. Before firing up it could retrieve the value of the variable, if non-null then convert it to an integer, and if that integer matches the currrent session() don't run at all. The variables can and will eventually get out-of-sync, but should reset when you close and open DOORS again. The above will allow multiple dialogs for different modules, and unfortunately will allow multiple dialogs for the SAME module so long as you fire up one from a different module first. If you use dynamic triggers to close your dialogs when the user closes the original module, you could query for the existence of such a dynamic trigger (for this module). - Louie |
|
![]() |
|
![]() |
|
Is there a way to disable the command on the menu that launches the dialog if the dialog is already showing?
I have a folder in the addins directory which creates a menu in DOORS, as well as a dxl file that is associated with a command from that menu. When the user selects the command, the dialog is shown. If I can disable that command when the dialog is showing, I would solve my problem. Any ideas on how to do this? Thanks. |
|
![]() |
|
![]() |
|
following on from Tony's suggestion of storing the db variable in the top context, define a mappingfunction which checks whether the db is null or not.
|
|
![]() |
|
![]() |
|
Adam.
If you create your menu items using createItem (p445 in the v7 DXL manual), you can define whether the item is Available, AvailableChecked, Unavailable or Invisible. But you seem to be saying you've created the menu via a subdirectory of AddIns (using the .idx file to describe items, presumably). Could you put the directory elsewhere and run some code to create the menus instead? Then you could disable (make Invisible) the command while the dialogue is visible. Paul. ------------------------- Paul dot Tiplady at TRW dot com TRW Automotive Edited: 12-Jul-2004 at 09:56 by Paul Tiplady |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Not launching multiple dialogs...
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.