Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Yet another form flashes problem
Message
 
To
22/06/2007 16:45:11
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01235113
Message ID:
01235228
Views:
15
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform