Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Not launching multiple dialogs...
Topic Summary:
Created On: 5-Jul-2004 21:18
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 5-Jul-2004 21:18
User is offline View Users Profile Print this message


Adam Terrenzio

Posts: 14
Joined: 24-Nov-2003

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.

Report this to a Moderator Report this to a Moderator
 7-Jul-2004 15:09
User is offline View Users Profile Print this message


Adam Terrenzio

Posts: 14
Joined: 24-Nov-2003

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?
Report this to a Moderator Report this to a Moderator
 7-Jul-2004 16:27
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 7-Jul-2004 20:25
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 9-Jul-2004 15:16
User is offline View Users Profile Print this message


Adam Terrenzio

Posts: 14
Joined: 24-Nov-2003

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.
Report this to a Moderator Report this to a Moderator
 9-Jul-2004 16:42
User is offline View Users Profile Print this message


Ross Morgan

Posts: 74
Joined: 15-Apr-2004

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.
Report this to a Moderator Report this to a Moderator
 12-Jul-2004 09:55
User is offline View Users Profile Print this message


Paul Tiplady

Posts: 176
Joined: 28-Oct-2003

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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.