Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making a really good main program.
Message
From
20/04/2001 17:47:23
 
 
To
20/04/2001 11:13:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00496424
Message ID:
00498168
Views:
21
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform