![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() Answer: This resolves my problem. Thanks! Catherine | |
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
This resolves my problem.
Thanks! Catherine |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
how to get the current module
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.