Condividi tramite


Running the Class Browser

You can run the Class Browser from the Visual FoxPro menu or from the Command window.

To run the Class Browser

  1. From the Tools menu, choose Class Browser.

    -or-

    Use the DO command and the _BROWSER system variable:

    DO (_BROWSER)
    

The program stored by default to the _BROWSER system memory is Browser.app. Browser.app accepts five optional arguments:

DO (_BROWSER) [WITH [tcFileName][, tcDefaultClass[.member]][, tlListBox][, tcClassType][, tnWindowState]]

Argument Description
cFileName The name of the .vcx, .scx, .olb, .tlb, .pjx, or .exe file to open in the Class Browser.
cDefaultClass[.member] The class in the .vcx to be selected by default. If no default class is specified, the class library is selected. If a member is specified, that member is selected in the Members list.
lListBox Specifies whether to display the classes and members in list boxes rather than treeview controls. Include true (.T.) for this parameter to display the list boxes. The default is false (.F.)
cClassType Specifies the initial Type filter for the classes displayed in the Class Browser. You can change the filter in the Class Browser by choosing another value from the Type list. The default is no filter.
nWindowState 0 - Normal (the default)
1 - Minimized
2 – Maximized
lGallery Default: .F.

Specifies whether to open in the Component Gallery instead of the Class Browser. Use true (.T.) to open in the Component Gallery.

For example, the following command opens the Class Browser maximized with the print_report class in Samples.vcx selected, the cmdOK object selected in the Members list, and the forms and members in Samples.vcx displayed in list boxes:

DO (_BROWSER) WITH "samples.vcx", "print_report.cmdOK", .T., "form", 2

To specify a default class and member name to open with the Class Browser

  1. Open the file in the Class Browser

  2. Highlight the file in the Class list of the Class Browser

  3. In the Command window, type the following code:

    DO (_BROWSER) WITH "mylib","myclass.cMessage"
    

You can also use the Class Browser to specify the default file to open when you start the Class Browser from the Tools menu or the Command window.

To specify a default library to open with the Class Browser

  1. Open the file in the Class Browser

  2. Highlight the file in the Class list of the Class Browser

  3. In the Command window, type the following code:

    _oBrowser.SetDefaultFile
    

This resets any previously specified default libraries.

You can add files to the default library opened by Class Browser.

To specify additional libraries to open with the Class Browser

  1. Open the additional file in the Class Browser

  2. Highlight the file in the Class list of the Class Browser

  3. In the Command window, type the following code:

    _oBrowser.SetDefaultFile(.T.)
    

To remove libraries from the Class Browser list

  1. Highlight the file in the Class list of the Class Browser

  2. In the Command window, type the following code:

    _oBrowser.ResetDefaultFile
    

To remove all libraries from the Class Browser list

  1. In the Command window, type the following code:

    _oBrowser.ResetDefaultFile(.T.)
    

See Also

Adding Controls to Forms with the Class Browser | _BROWSER System Variable | Browsing Classes with the Class Browser | Class Browser Buttons | Class Browser Methods | Class Browser Properties | Class Browser Window | Customizing the Class Browser | Filtering the Class Browser Class List | Managing Classes with the Class Browser | Modifying Class Icons and Descriptions | Running the Class Browser | Viewing Class Definition Code