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: Update Button
Topic Summary:
Created On: 24-Oct-2006 15:53
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.
 24-Oct-2006 15:53
User is offline View Users Profile Print this message


Simon Gwilliam

Posts: 4
Joined: 24-Oct-2006

I have written some DXL that totals some values in a DOORS 5.2 module. I'd like to create a button that can be pressed by the user to run the code and update the values whenever he/she would like to. From discussions with colleagues, it looks as though the best way to do it is to have a code running in the background, waiting for the perticular module in question to be opened which will then create a button in the module. I have found the 'button' section in the DXL reference manual but I am having trouble implemeting it.

Does anyone have any ideas?

Report this to a Moderator Report this to a Moderator
 24-Oct-2006 23:30
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Not too keen on 'adding a button to a module' or dynamically modifying menus.

Such 'code in the background' could be a post-module-open trigger assigned to that one module; in which case its not really running in the background. You can tamper with module menus but I'd write code that created a new dialog that housed the button in question.

Actually, I'd have a trigger that fired when the module was open visible and exclusive, asking the user if he wants to do the update; she could Confirm or Cancel. This scheme would demand a response before DOORS did anything else.

- Louie
Report this to a Moderator Report this to a Moderator
 25-Oct-2006 09:49
User is offline View Users Profile Print this message


Simon Gwilliam

Posts: 4
Joined: 24-Oct-2006

Many thanks for the reply Louie.

The only problem I can see with what you are suggesting is that I don't wish to ask the user if he/she would like to update as soon as they open the module. Instead I wish to allow the user to update the totals once he/she has made changes.

I basically need some quick way of running my code without having to use the root:

Tools -> Edit DXL -> Load

Is there anyway I can do this?

Report this to a Moderator Report this to a Moderator
 25-Oct-2006 16:49
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

The post-module-open trigger could build a dialog that has your button. You can associated that dialog with the Module window such that the dialog disappears if you close the module. This method allows the user to do other things while the dialog is displayed. The bad feature is that the dialog will tend to get hidden as the user uses windows.

There must also be some way to add an menu item to this particular module only. There must also be some other way to have a particular Icon on the taks bar (sibling to the 'save' and 'print' icons). I don't know how to do that.

You could also have a pre-module-close trigger such that if this module is open edit, you could then prompt the user to do calculations, in either case close the module. Suppressing this prompt if the user hasn't done anything is a little tricky ('unsaved' doesn't work well and will fail if the user saves then closes); I'd parse through History seeing if there were changes during the current session.

You could also have some sort of post-attribute-save trigger that displays the calulations dialog if its not already showing.

Triggers are tricky. If someone tells you how to create an ICON then do that.

- Louie
Report this to a Moderator Report this to a Moderator
 25-Oct-2006 17:04
User is offline View Users Profile Print this message


Simon Gwilliam

Posts: 4
Joined: 24-Oct-2006

Thanks very much for the help Louie. We have got it pretty much sorted except for getting it to open when the module is opened. I'll see what I can do based on what you have said and I'll let you know.

Ta
Report this to a Moderator Report this to a Moderator
 26-Oct-2006 10:03
User is offline View Users Profile Print this message


Paul Tiplady

Posts: 176
Joined: 28-Oct-2003

Don't know if it works in v5.2, but in v7.1 I've got entries in a drop down menu that are made active or inactive (greyed out) based on whether a module attribute in the current module exists and has a particular value. This could be an alternative to the dialogue box.

You'd need a module attribute that indicates the type of the current module (we use one as standard in all our formal modules, for that very purpose), which is tested by code in a file (name doesn't matter!) in lib\dxl\config\formalFiles.

The code should look a bit like that in 'formalTRWMenu.inc' attached, where the first parameter to 'createItem' is the name of a function ('UCActive', which is in baseWindowCallbacksTRW.dxl (attached), which lives in lib\dxl\config\baseWindowCallbackFiles) that indicates whether the menu item is active or not. The last parameter in 'createItem' is the code to run in response to clicking the item.

I also suspect this same principle can be used to create buttons on the menu bar, which are similarly disabled if the 'wrong' module is open, but I haven't tried that.




-------------------------


Paul dot Tiplady at TRW dot com
TRW Automotive

Edited: 26-Oct-2006 at 10:05 by Paul Tiplady
Report this to a Moderator Report this to a Moderator
 27-Oct-2006 19:41
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

... and deploy that on all the Clients ... and redeploy that on all the clients after they are patched.
Report this to a Moderator Report this to a Moderator
 30-Oct-2006 08:47
User is offline View Users Profile Print this message


Paul Tiplady

Posts: 176
Joined: 28-Oct-2003

Ah ... deployment. I knew you'd spot the catch.

But at the moment, it's not proving to be a problem here. Deployment is done via a zip file and some elementary instructions. It's going to be a nightmare one day, when there's more than just me deploying scripts and we start to get conflicts with additions to menus (two different versions of the same file with incompatible extensions...), but for now, with not too many users, each of which requests the zip file when they discover they can't do something they thought they ought to be able to, it's working.

-------------------------


Paul dot Tiplady at TRW dot com
TRW Automotive
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 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 2 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.