Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Yet another form flashes problem
Message
 
À
22/06/2007 16:45:11
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:
01235228
Vues:
14
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