Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Custom Objects
Message
De
17/07/2001 10:34:48
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, États-Unis
 
 
À
17/07/2001 09:19:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
Divers
Thread ID:
00531332
Message ID:
00531525
Vues:
12
Hi Craig,
I originally had it that way, but for ease of use, I changed to
IF VARTYPE(m.ThisApp) = "U"
   PUBLIC ThisApp
ENDIF
ThisApp = This
in the load of the application object. Otherwise I can't use ThisApp in various objects until the Application object's INIT is complete. I don't require a Main.PRG in development mode--just DO FORM ApplicationName. The ApplicationObject is based on a form.
AlwaysOnBottom = .t.
TitleBar = 0 OFF
WindowState = 2 Maximized
This allows ThisApp.Resize to work with no effort. (Thanks Fred Taylor.)
In production mode I add a
ThisApp.ReadEvents()


>I agree. An Application Object is what he wants. However, I think it should be PRIVATE in the Main.Prg.
>
>
>>Hi Bob,
>>Seems to me that you are asking for an Application service. I use one public variable, ThisApp, and it has ways of getting that kind of information. In the case of UserName, it's held in the UserHandler object. You want to be able to test the form on it's own, without the full Application running. Therefore, the code might look like this:
>>
>>LOCAL UserName
>>IF VARTYPE(ThisApp) = "O"
>>   UserName = ThisApp.GetProperty("UserName")
>>   * The GetProperty method of the app can look at various
>>   * objects in the app object and see if they have the property
>>   * we're interested in.
>>ELSE
>>   * Perhaps create an object here to help,
>>   * or default to something easy.
>>   UserName = "PC User"
>>ENDIF
>>
>>
>>>If I were to create a custom object, for keeping track of few propertities like
>>>say username and userlevel (application level)
>>>and if I put the object on my base class forms....
>>>
>>>How could i set the propertites, of the base object once, and have all the other forms which the object be able to read the propertites. ?
>>>
>>>I hope that I am making sense here. what I am attempting to do, is not use a public array to store this type of but to use a more oop method ... should this,. or can this be done ?
>>>
>>>Bob Lee
Charlie
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform