Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I use a modeless form?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00501150
Message ID:
00501187
Vues:
23
Well I just tried something an it worked.
created a custom class, that had two custom properties and one custom method
the propertities were nameofclass and clstolaunch
the custom method called launch did this.
lPARAMETERS m_para1,m_para2,m_para3
do case 
CASE PARAMETERS()=0
this.nameofclass=CREATEOBJECT(this.clstolaunch)
CASE PARAMETERS() = 1
this.nameofclass=CREATEOBJECT(this.clstolaunch,m_para1)
CASE PARAMETERS() = 2
this.nameofclass=CREATEOBJECT(this.clstolaunch,m_para1,m_para2)
CASE PARAMETERS() = 3
this.nameofclass=CREATEOBJECT(this.clstolaunch,m_para1,m_para2,m_para3)
ENDCASE 
this.nameofclass.show()
I put this class in my baseclass of my forms, and from any form, I can easly call more modal forms without loosing scope, or setting up public memvars. !

can you think of anything I am missing. ? (ps the best part is it works)
Bob Lee

Big Big thanks. !


>>>>>>>>>>>>
>>I guess you see why I am looking for a framework. the idea or concept of an application class is a new one for me today. ! mY gut feeling when I did some tests was that that public var before I created a class, was going about things, just badly.
>>
>>BYW, do you have a pointer or link to what you call an appliation class? so I can get at least the idea...
>>>>>>>>>>>>
>
>You probably have (or had) a prg full of utility functions, right? You can still SET PROCEDURE TO utility.prg , nothing really wrong with that. A more OOP way is to create a class, non-visual, maybe based in Custom. Add methods and properties to it as needed. Each of your old utility functions would be a method. The properties allow your class to maintain state. So you could create a method to save the TALK state, or DELETED, or the current ALIAS, or all of the above.
>
>Try the following:
>Make a class (custom) to save ALIAS. In Init() you save current alias to a property. In Destroy() you return ALIAS to the one saved in the property.
>
>Then you do:
>
>LOCAL loSaveAlias
>loSaveAlias = CreateObject("SaveAlias")
>SELECT MyNewAlias
>* do some processing
>RETURN
>
>
>Note that you do not require to remember to go back to the previous ALIAS before RETURNing. When it goes out of scope, it triggers the Destroy() that will reset your ALIAS (same would work for SET DELETED ON|OFF, etc.)
>
>Here you have an example of a utility class that you put in your utilities.VCX and you use throughtout your app.
>
>HTH
In the beginning, there was a command prompt, and all was well.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform