Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Yet another form flashes problem
Message
De
25/06/2007 09:45:34
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01235113
Message ID:
01235323
Vues:
12
Jim, thanks for the suggestion. I understand READ EVENTS properly, I just put in the extra code examples to forestall peoples suggestions that I try these things. I should have made this more clear.

The part I don't get is why SHOW() or SHOW(1) fails to stop and let the form display. Like everyone else, I've got a zillion forms that call other forms and so on and I've always just used SHOW(). Using a form level property gets the job done. Sometime later, I'll dig into this. Perhaps it's the COM object that is altering the behavior. Anyway, thanks again.

Gary

>Gary,
>
>Y9u are misunderstanding the action of READ EVENTS. READ EVENTS tells VFP to go into a wait state and allow the user to take an action. It remians in effect until a CLEAR EVENTS is encountered. This means that can be ONLY ONE READ EVENTS is effect. Any additional ones are ignored. IN your sample code you instantiate the picker form and in its LoadFiles method you issue a READ EVENTS. Code execution stops right there until CLEAR EVENTS is issued. The READ EVENTS in the viewer form is ignored completely.
>
>Instead try using an approach like this outline below;
>
>
>* Start up program.
>LPARAMETERS tcMemberID, tcSourceDir
>
>SET SAFETY OFF
>_screen.Visible = .F.
>
>oViewer = CREATEOBJECT('Viewer')
>oViewer.LoadFiles(tcMemberID, tcSourceDir)
>
>READ EVENTS
>RETURN
>
>
>Remove all of the other READ EVENTS you have everywhere else!!!
>
>Now in the click event of the button in the picker form do something like this;
>
>
>LOCAL cFileName, oForm
>
>IF this.Parent.lstFiles.ListIndex > 0
>   cFilename = thisform.aFiles[thisform.lstFiles.ListIndex, 2]
>   IF FILE(cFileName)
>      oForm = CREATEOBJECT('PdfViewer')
>      oForm.DisplayPdf(cFileName)
>      oForm.Visible = .T.
>      oForm.Show(1) && Make it modal
>   ENDIF
>ENDIF
>
>
>Now in the OdfViewer form provide a Quit or Exit button that does;
>
>
>Thisform.Release()
>
>
>And in you PdfPicker form also provide a Quit or Exit button that does;
>
>
>Thisform.Release()
>
>
>In the Unload event of the PdfPicker form put;
>
>
>CLEAR EVENTS
>
>
>That should make your forms work togehter well the way you want them to.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform