What is the difference between void block(DB box) and void show(DB box)
? thsturm - Tue Nov 23 09:32:14 EST 2010 |
Re: Difference between block() and show()
The 'block' displays a 'modal' box which MUST be disposed before you can do anything else in DOORS. Typical 'ack' boxes are 'modal', you must say [OK] to unlock the rest of the interface. The 'show' displays a normal dialog which does NOT prevent interaction with the rest of DOORS. When you 'show' a dialog, the user can still navigate in the module. There are some things that must be done after a dialog is 'realized' and before is it 'show'n or 'block'd. [1] Your various callback/button/apply functions should simply 'release(db)' as the last thing they do, if they want to close the dialog. [2] Any applyClose() you write should likewise simply 'release(db)'. [3] the main code that creates the dialog should 'closeOutDB()' immediately after the 'block(db)' statement.
void CloseOutDB()
{ hide(db)
destroy(db)
db = null
} // end CloseOutDB()
|
Re: Difference between block() and show() Note that while a DXL program is running, no DOORS windows will react to user input. If you do show, the DXL parser will end the DXL program(!) (which means the other DOORS windows will react again to your input) but keep its memory ressources active until the dialog is hidden, meaning the GUI will still be on the screen and react to user input (GUI callbacks being executed). So show really is pretty much like a "halt". Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Difference between block() and show() From where can I get this details? Is there more than the DXL Reference Manual (and many, many try and error :( ? |
Re: Difference between block() and show() llandale - Tue Nov 23 14:34:23 EST 2010
The 'block' displays a 'modal' box which MUST be disposed before you can do anything else in DOORS. Typical 'ack' boxes are 'modal', you must say [OK] to unlock the rest of the interface. The 'show' displays a normal dialog which does NOT prevent interaction with the rest of DOORS. When you 'show' a dialog, the user can still navigate in the module. There are some things that must be done after a dialog is 'realized' and before is it 'show'n or 'block'd. [1] Your various callback/button/apply functions should simply 'release(db)' as the last thing they do, if they want to close the dialog. [2] Any applyClose() you write should likewise simply 'release(db)'. [3] the main code that creates the dialog should 'closeOutDB()' immediately after the 'block(db)' statement.
void CloseOutDB()
{ hide(db)
destroy(db)
db = null
} // end CloseOutDB()
I am not sure why this error is copy/pasted over and over again, but don't call destroy from a callback. It says so in the help and will lead to crashes under certain circumstances. @thsturm: reading or asking in the forum, studying the perms list, the DXL Manual or trial & error (in this order) are the main information sources I guess :-) Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Difference between block() and show() Mathias Mamsch - Wed Nov 24 09:11:36 EST 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS It must surely be ok to 'destroy' from the callback associated with the 'close' button, or in fact from any 'button' or 'apply'; just make sure you 'hide' it first and you should set the global DB to null aftewards. If its not OK to do so they you cannot 'destroy' a 'shown' dialog. I suspect the issue with the non-standard callbacks is that after you click the DBE and run the code, DOORS still process the 'click' that triggered the callback and tries to deal with the DBE, which no longer exists because it was just destroyed (analogy: "open the mail, burn the mail, read the mail" doesn't work). Not so with close/button/apply where nothing happens after that code runs. In any case, I've never had a problem with it, at least for non-modal dialogs. As I said the modal ones should simply 'release(DB)' and let the main code hide and destroy it. But then, I wonder if a modal callback should 'release'?...
|