Session E-WIZ

Modifying the Visual FoxPro Builders and Wizards

Rod Paddock
Dash Point Software, Inc

What we will cover today...

  • Finding the VFP Wizard/Builder Code
  • What's in the Source Code
  • How the Wizards are Architected
  • Modifying the Wizards
  • Creating your own Wizard

Finding the Code

  • VFP Now Includes Wizard Source Code !!!

What's in the Source Code

Source Code Included For:

  • Wizards
  • Builders
  • Class Browser
  • Component Manager
  • Coverage Profiler

Building Your Own Wizard

In the last section you learned how a wizard is constructed and how to modify the Web Page Wizard. Now you should learn how to create a wizard of your very own. This next section demonstrates the steps necessary to create a wizard from the provided class library files.

  1. Create a new directory for your wizard project.
  2. Create a project in the directory you just created. Call the project WWS_WIZ
  3. Add the WZENGINE.PRG, WIZARD.VCX and WIZCTRL.VCX to your project. These files are contained in the WZCOMMON directory.
  4. Create a new program file. Name it the same as your project file. Copy the following code into the new file:
   DEFINE CLASS wws_Engine AS WizEngineAll
   *- special initialization code for your wizard
   PROCEDURE ProcessOutput
   Messagebox("We should definitely generate something here")
  1. Copy the WIZSTUB.PRG file to your project. Give the file the same name as your project concatenated with the word START. (i.e. WWSSTART.PRG) Mark this file as the startup file for your project.
  2. Subclass the WizTemplate class found in the WIZARD.VCX. Save this into a new class library. Give the class library the same name as your project. (i.e. WWS_WIZ.VCX)
  3. Modify the class created in step 6. Change the following properties:
cEngineClassName = "wws_Engine"
cEngineProcedure = "wzEngine,wws_wiz"
  1. Modify the InitSteps of the class created in step 6. This method tells the wizard how many pages it will have and what description to provide for each step. The last step you add will be the step shown on the Finish page. The following code adds two pages to the wizard:
This.AddStep("1. My First Step","My First Wizard Step")
This.AddStep("2. My Second and Final Step","My Second and Final    Wizard Step")
  1. Return to the program file created in step 5 and make the appropriate changes to that file. The changes necessary can be found by searching for << in the program file and making the designated changes.
  2. Add data entry fields to your wizard pages. Remember to add these fields to the second pageframe.
  3. Final output options go on Page2 of the topmost pageframe.
  4. Modify the ProcessOutput method shown in step 4. This method is called when the user presses the Finish button on the last page of your wizard. The data entry fields added to your wizard can be accessed through a variable called oWizard. This variable is an object reference to your form and the pages contained within that wizard. The following code demonstrates the final output of the wizard you just generated:
   PROCEDURE ProcessOutput
   *-- Test output type option grid
   If oWizard.form1.pageframe1.page2.opgOutputType.Value = 1
   Wait Window oWizard.form1.pageframe1.page1.pageframe1.page1.txtLastName.Value
  1. Build and run your new wizard.

About Me


  • Co-Author VFP 6 Enterprise Development
  • Co-Author Hands on VB6 For Web Development

Microsoft MVP