The Visual Class Designer is a superset of the Form Designer. When creating classes visually, Microsoft Visual FoxPro 3.0 allows us access to the controls toolbar, the properties window as well as the visual canvas. Figure 1 shows the Visual Class Designer when working on a commandbutton based class:
Figure 1: Visual Class Designer
The CREATE CLASS command allows access to the class designer. A dialog is presented to name the class, specify the base class and specify the name of the .VCX file in which to store the class. Figure 2 is a sample of this dialog.
Figure 2: Class Definition Dialog
Classes may be based on FoxPro base classes or any class you create.
Like coded classes, we can add properties and methods to classes we create, regardless of the base class. As shown in Figure 1, the Class menu has options to allow us to create a new method or property to our classes. Selecting one of these options displays the dialog shown in Figure 3. Note that checking the Protected check box will make the method or property protected.
Figure 3: Defining a New Method
The new method or property, once defined, is automatically added to the properties dialog:
Figure 4: Property Window with New Method
Now that we have seen the visual class designer, let's see what we can do with it.