rPreview does not close when app closes

User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: rPreview does not close when app closes

Post by nageswaragunupudi »

reinaldocrespo wrote:Hi and thank you everyone. This is good brainstorming.

I think the following code incorporates from all of your ideas. It seems to do the trick. Please advise on your opinion:

Change Method Activate() on rPreview to:

Code: Select all | Expand


     if ::oDevice:lPrvModal
        StopUntil( { || ::lExit .or. WndMain() == Nil .or. !IsWindow( WndMain():hWnd ) } )
     endif

 



This closes all the open rpreview windows when the main app is closed. Am I missing/forgetting/ommiting something?


Reinaldo.

This has the side effect of the preview window going behind the dialog where there is no wndMain() and the program is started with a dialog.

Test program:

Code: Select all | Expand

#include "fivewin.ch"
procedure main()
   xbrowse( "\fwh\samples\customer.dbf" )
return



Before finalizing a modification to a program like RPreview, we need to test the code in all these cases:
1. MDI application
1.1 From MDICHILD (a) Modal and (b) Nonmodal
1.2 From a Dialog inside the app (a) Modal and (b) Nonmodal
2. Normal window
2.1 From Window (a) Modal and (b) Nonmodal
2.2 From a Dialog inside the app (a) Modal and (b) Nonmodal
3. App starting with a Dialog
3.1 From main dialog (a) Modal and (b) Nonmodal
3.2 From a subdialog (a) Modal and (b) Nonmodal
We also need to test any processes initiated by any button of the preview window in all the above cases.
Regards

G. N. Rao.
Hyderabad, India
Post Reply