Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modeless form class persistence
Message
From
08/04/2002 17:44:23
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00642384
Message ID:
00642397
Views:
16
This message has been marked as the solution to the initial question of the thread.
>I have done some research on this but haven't found the answer to my specific problem, so here goes:
>
>I have a hybrid program which is slowly being converted to an OOP environment. I have multiple levels of programs (PRG's) called from menus that basically instantiate modeless form classes, then return to the main menu. However, soon after the form class is created, the calling program closes and with it, the modeless form. The read events is up at the main program level and is an impractical place to spawn the new forms.
>
>Is there a way (besides global variables) to either create or attach an object to keep a modeless screen open after the calling program is finished? The forms need to be modeless so the user can open multiple modules of the program at one time.
>

Generally, this is done with a form manager object. Of course, that manager object has to be referenced somewhere. Many frameworks use a global variable like oForms, some would add it to _screen so it is _Screen.oForms. But, it doesn't matter where it is...

The idea being that the form object is sort of like a collection. Every time a form instantiates it passes a reference of itself to the form... for example in the init of the form you might have code like _Screen.oForms.Add(this). The forms object holds the reference so the form doesn't go away when the DoForm program that calls it ended.

Also, once you have the form object you can add functionality (methods) to it to do things like Cascade and Close all.

BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform