[ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7] [ 8 ] [ 9 ] Menu templates <PJXNAME>_MAIN,_TOP,_APPEND, and _GOThere are four template menus provided for each generated application. Three of the menus correspond to each of the three "application types" to which the Application Builder gives you access. The Application Builder fills the application object's cStartupMenu properties with appropriate information, depending on the app type you pick. If you have not created top form menus in the past, you may find some of the Cleanup code in the _TOP.MNX generated menu quite unusual. For example: IF EMPTY(APP_GLOBAL.cHelpFile) SET SKIP OF BAR 1 OF (a_menupops[9]) .T. ENDIF Note the use of an array element, rather than an explicit popup name, in this code. The framework takes advantage of GENMENU's ability to provide menu popups with unique generated names for all top form application menus. This can be important if you have an application that juggles several independent frames on the desktop. The framework uses the fourth menu to add a navigation context menu to existing menu bars, for forms that you've indicated (in the metatable) should have such a menu. The Application Builder fills the app object's cGoMenuFile property with appropriate information and also switches information in the MNX to toggle this menu between a top form and standard menu. Document register/metatable, <PJXNAME>_APP.DBFThis table has already been mentioned briefly, and will be described in detail in the section on Project Hook and Application -driven project components, below. The Application Wizard creates it, but the real work of filling it out happens later. A few miscellaneous text filesA generated CONFIG.FPW appears in your project directory, with appropriate values you will want to consider when you create EXEs for framework-enabled applications. This is really just a convenience for you, and an education for your beginning developers, since the values here are common-sense recommendations for most EXEs. As with the generated .H file, you'll find plenty of notes within the CONFIG.FPW. There's also a generated file with the name <PJXNAME>_APP.TXT. This file allows project hook objects a chance to register actions they take on your project, throughout the project's life. The shipping project hook object does not add many details to a log, but we'll subclass the project hook object in this session's examples, to perform this service among others. Change the Wizard-generated componentsThe Application Wizard uses a table named _FRAMEWK.DBF to generate all the pieces of your application. You should find this table in the HOME()\WIZARDS directory, with _FRAMEWK.VCX/VCT and the header file used by the _FRAMEWK superclasses, _FRAMEWK.H. _FRAMEWK.DBF contains all these pieces in memo fields, as files. Therefore, to change what the Wizard generates, you change what's inside _FRAMEWK.DBF. The OOP pieces are all straight subclasses of _FRAMEWK.VCX classes. They go into the _FRAMEWK.DBF as the contents records labelled T_META.VCX and T_META.VCT. These items don't become part of your classes' inheritance tree; effectively they are the application-level classes, with different names. T_META.VCX/VCT exists so the Application Wizard can avoid generating these subclasses when it generates the rest of the application. The standard Application Wizard implementation has a number of constraints:
Some (but not all) of these constraints occur because the VFP 6 Application Wizard actually calls the older VFP 5 Application Wizard to do much of its work. In the APPWIZ folder of your source code for this session you'll find an "improved" version of the Application Wizard. It has the following advantages:
If you DO NEWAPPWIZ.PRG, provided in the NEWWIZ folder, you will get a dialog almost identical to the shipping VFP 6 Application Wizard and functionally equivalent to the original dialog. The only difference you'll notice is a request, on startup, asking you if you wish to register this wizard in your HOME()+ "Wizards\WIZARD.DBF" table for future use (see the next figure).
Executing NEWAPPWIZ.PRG gives you a version of the VFP 6 Application Wizard that looks exactly like the shipping one, but is different "underneath". Execute NEWAPPWIZ.PRG again, this time with a second parameter indicating a different Wizard subclass to instantiate: DO NEWAPPWIZ WITH , "AppWizReinherit" * don't forget that leading comma! You should get another messagebox, similar to what you saw before, asking you if you want to register this subclass in the WIZARD.DBF table. When you've dismissed the messagebox, you see the dialog in the next figure.
App Wizard with "reinherit" features. The first page in this dialog handles the "standard" Wizard requirements, and each subsequent page addresses one of the constraints mentioned earlier. Because some of these requirements require you to understand the relationship between different framework components, each page delivers an explanation of its task. In the next figure you can see the dialog's second and third pages.
The "Reinherit Wizard" allows your team to take control of the components the Application Wizard uses to generate a VFP 6 framework application. |