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: how to get the current module
Topic Summary:
Created On: 25-Jul-2005 23:43
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.
Answer This question was answered by Catherine Yan, on Friday, July 29, 2005 7:08 PM

Answer:
This resolves my problem.

Thanks!
Catherine
 25-Jul-2005 23:43
User is offline View Users Profile Print this message


Catherine Yan

Posts: 43
Joined: 4-Aug-2003

I have a script that updates the current module. Is there a way I can keep my dialog box open, switch to another open module and the dialog box will figure out this new module (not the one I used to open the dialog box) is the current module?

THanks!
Catherine
Report this to a Moderator Report this to a Moderator
 26-Jul-2005 22:44
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Nope.

A DXL script keeps track of its own "current module" which it can change but I can think of now method for it to detect something like "the last displayed module" or anything like that. I've tried this for a while and if someone comes up with a method then .. well .. I'll be embarassed but use it.

That is, it won't detect when YOU manually change the module. But it can be written to open other such modules and switch to them

- Louie
Report this to a Moderator Report this to a Moderator
 27-Jul-2005 13:04
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

There is (nearly) a way to do this.

You can use an object sync trigger to detect the current object and from this you have the module. This relies on the user clicking on an object before the new "current" object is detected.

This is how to do it:

Add a couple of globals to startup.dxl:

Module myCurrentModule = null
Object myCurrentObject = null


Create a project-wide object sync trigger as follows:

string dxlString = "

myCurrentObject = current Object

if (!null myCurrentObject)
{
myCurrentModule = module(myCurrentObject)
}

"

Project p = current Project

if (null p)
{
infoBox("No current project")
halt
}

string triggerName = fullName(p) ": ObjSyncTrig"

trigger(triggerName, project->module->all->formal->object->all, post, sync, 5, dxlString)


Then test it using the attached.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 27-Jul-2005 13:36
User is offline View Users Profile Print this message


cliff Bly

Posts: 58
Joined: 11-Apr-2003

Not sure how you would fit this into your dialog dxl but check the thread on "Undocumented DXL functions and Types". One reply has the following UNSUPPORTED FUNCTIONS listed:

Module lastSelectedModule_()
Object lastSelectedObject_()


As stated before, the dxl will maintain its view of the "current" module.
If you set Module mselected = lastSelectedModule_, mselected will be the last user selected module while the dialog box is running.

Then if you wanted to switch the "current" module just " current = mselected".

-------------------------
Cliff Bly


Edited: 27-Jul-2005 at 13:37 by cliff Bly
Report this to a Moderator Report this to a Moderator
 27-Jul-2005 22:23
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

So you declare current module-object variables in the top context. Whenever an object is selected it triggers code to update these attributes. The dialog, when invoked, checks the global variables to figure out what's current.

Can we declare these variables from a script without modifying startup.dxl? If the dialog script issued a evalTop_ more than once, would it generate errors?

- Louie
Report this to a Moderator Report this to a Moderator
 29-Jul-2005 19:08
User is offline View Users Profile Print this message


Catherine Yan

Posts: 43
Joined: 4-Aug-2003

Answer Answer
This resolves my problem.

Thanks!
Catherine
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.