Condividi tramite


Specifying a Builder Application with Builder.dbf

You can use the Builder.dbf table to specify a builder application. Each record contains fields that represent the name of a builder, optionally, a description of the builder, and a field called Type that identifies the Class or Base Class property that invokes the custom builder. For instance, the Type entry for a CommandButton is Commandbutton and the Type entry for the Autoformat builder is Multiselect because it runs against multiple selected controls.

The following table describes a BUILDER table record.

Field Name Field Type Width (comment)
NAME Character 45 (Builder name)
DESCRIPT Memo 4
BITMAP (unused) Memo 4
TYPE Character 20
PROGRAM Memo 4 (Builder application)
CLASSLIB Memo 4 (Class Library name)
CLASSNAME Memo 4 (Builder Class)
PARMS Memo 4 (passed parameter list)

The named builder application compares the value in the Type field and the Class of the object and starts if there is a match. If more than one match is found, a selection dialog displays.

By default, the Builder.app application passes three parameters, listed in the PARMS field of Builder.dbf, to a builder program:

PARMS Entry Description
wbReturnValue Variable containing a value to be returned to the Builder.app.
<character string> A literal string to pass to Register table.
<optional value> A keyword or other value to pass to Builder.app

To create a custom builder

  1. Write an application that provides an interface and modifies the selected control or controls.

  2. Save the application in the Wizards folder.

  3. Open the Builders.dbf table and append a new record.

  4. Enter values for the Name, Descript, Type, and Program fields.

    If your custom builder uses additional values, you can also enter values for the remaining fields.

After you complete all entries and close the Browse, the new builder is registered. For example, if you create a program that changes the fonts of selected controls, then save the program in a file called Chgfont.prg, the following table shows the entries for Builder.dbf.

Field Name Value
NAME The Builder That Changes Fonts
DESCRIPT This builder modifies the font of all selected controls
TYPE MULTISELECT
PROGRAM Chgfont.prg

When you use the builder, Visual FoxPro displays the Builder Selection dialog box because there are now two builders of the Multiselect type. When you choose the "The Builder that Changes Fonts" option, Builder.app runs the program you saved as Chgfont.prg.

See Also

Builders | Application Builder | Builder System Variable | AutoFormat Builder | Combo Box Builder | Command Group Builder | Edit Box Builder | Form Builder | Grid Builder | List Box Builder | Option Group Builder