Builders are similar in concept to Wizards. The Builders provided with FoxPro will be running some of the same code as the Wizards. A helpful way to think about their differences is that a Wizard guides you through a process to accomplish a common task, while a Builder works with an existing object and helps you set its properties the way you want.
The number of objects and properties in FoxPro can seem overwhelming at first. Using Builders is a great way to learn about properties and to find those you'll want to frequently set. As you become more experienced, Builders offer ways to accomplish your development tasks more efficiently. Ultimately, you can harness the power of Builders and leverage the product's hooks to significantly accelerate your development process.
Direct Help for Building Controls in the Form Designer
FoxPro will contain a collection of standard Builders designed to help you build BaseClass controls in the Form tool. We'll briefly discuss these Builders to see how to invoke them and what they do. The following is list of some of the standard Builders and a number of the object properties they modify:
Builder |
Properties modified |
Option Group |
Number of buttons |
ListBox |
List Source |
Grid |
Grid Source |
Form |
Presentation Style |
ComboBox |
List Source |
Command Group |
Number of Buttons |
AutoFormat |
Border |
There are several hooks built into the product for calling Builders: the Builder button in the Properties window, the Alternate Mouse-Button menu, the Builder Lock button with its Preference setting in the Options dialog box, and the Form Builder button on the Standard toolbar.
Invoking the Builder With the Alternate Mouse-Button Menu
The Builder Lock Button on the Form Designer Toolbar
Builders can work against any controls you like; there simply needs to be a way to call the Builder and tell the product which Builder you want to run. Objects always have a Class property and a BaseClass property. When you subclass a control, for example a list box, and you call the class "MyListbox," the Class property of such an object is "MyListbox" and its BaseClass property is "Listbox."
Depending on how the Builder is registered, and on the workings of your Builder driver program (as described later), you can run a Builder against instances of "MyListbox" only, or against any and all list boxes.
All of the Builders that ship with the product are modal formsets. A modeless Builder would allow access to the Command Window and the full functionality of the product, raising the possibility that the user may take actions that would prevent the Builders from functioning correctly. Microsoft's Builders are, therefore, modal—you may; however, make your own Builders modeless, but you need to handle the implications in your Builder.