Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Making a really good main program.
Message
 
 
À
20/04/2001 11:13:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00496424
Message ID:
00498168
Vues:
22
>Your main program is godd, eventhough there are some code lines that I not understand.
>Are you able to explain it with an example.?

The way I do it is the following:
The important part of the main.prg is the instantiation of the application control object. I create a class that is based on the container class (so I can drop other objects on it if I need to).
I add for example two properties, SplashScreen, WindowMaximized, and three methods, RunApp ShowSplashScreen and ShowMenu.
The RunApp method is called by Main.PRG and does the following:

IF THIS.SplashScreen = .T.
*-- Show a splash screen.
THIS.ShowSplashScreen()
ENDIF
*
*-- If WindowMaximized is set to .T., show the screen maximized.
_SCREEN.VISIBLE = .T.
IF THIS.WindowMaximized = .T.
_SCREEN.WINDOWSTATE = 2
ELSE
_SCREEN.WINDOWSTATE = 1
ENDIF
*-- Now show the application menu.
THIS.ShowMenu()
RETURN .T.

You can add as many properties and methods as you think of that can determine the look and functionality for your applications. For example, if you do want to display a splash screen in your application, you simply set the SplashScreen property to .F., you do not need to change the code as you would have to do in a main.Prg that needs to handle all this stuff.
Christian Isberner
Software Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform