What are Builders?

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
Standard or Graphical appearance
Horizontal or Vertical Layout
Spacing
Border Style
Data Source

ListBox

List Source
Style (3d)
Dimensions
Incremental Searching
Column Layout
Return Value Source
Data Stored Location

Grid

Grid Source
Presentation Style
Column Layout
Column Control Type
Source Data Relationship

Form

Presentation Style
Horizontal or Vertical Layout
Multiple Column Options
Data Source

ComboBox

List Source
Style (3d)
Combo or List
Incremental Searching
Column Layout
Return Value Source
Data Stored Location

Command Group

Number of Buttons
Captions
Graphics
Horizontal or Vertical Layout
Spacing
Border Style

AutoFormat

Border
Colors
Fonts
Layout
3D Effects


Product Hooks

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

Native Controls and Subclassed Controls

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.

Modality

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.