Class Browser Methods

See Also

The following methods are associated with the Class Browser.

AddClass( )

Copies a class from one class library (.vcx) file to another. Used after a drag-and-drop operation between instances of the Class Browser and dependent on the oSource property. If the specified class does not exist, a class is created.

AddFile( )

Adds a class library (.vcx) or form (.scx) file to the Class Browser class list. If no parameters are passed, an AddFile dialog box appears by using the Class Browser GetFile( ) method. If lIgnoreRefresh is true (.T.), the Class Browser class list is not refreshed. If you are adding multiple files, you can wait until all classes are added before refreshing the list.

Syntax: AddFile([cFileName][, lIgnoreRefresh])

AddIn( )

Installs or removes the specified add-in to the Browser.dbf registration table.

Syntax: AddIn(cName[, cProgram] [, cMethod] [, cFileFilter] [, cPlatform][, cComment])

Arguments

AddInMenu( )

Expands the menu that displays the registered add-ins.

AddInMethod( )

Executes any registered add-in for the specified object method.

Syntax: AddInMethod(cObjMethod)

Example: To change the default behavior of the Help button in the Class Browser, use the following code:

_OBROWSER.AddInMethod("cmdHelp.click")

AutoRefresh( )

Determines whether to refresh the display by checking for updated class library (.vcx) information in the selected class in the class list, and by checking the total number of records in the class library (.vcx) file being edited. This method runs when the Class Browser form is activated.

BinToInt( )

Returns the integer equivalent of a string representing a binary value. For example, passing this method a cBinaryValue of “11001” would return 25.

Syntax: BinToInt([cBinaryValue])

CleanUpFile( )

Removes records from the class library (.vcx) file associated with the selected class in the class list.

ClearBrowser( )

Internal use only.

ClearClass( )

Clears the class cache from memory with the CLEAR CLASS command for a specific class, or all classes displayed if lClearAll is set to true (.T.).

Syntax: ClearClass([lClearAll])

NewClass( )

Creates a subclass of the selected class in the class list.

DeactivateMenu( )

Deactivates the add-in popup menu.

DisplayMenu( )

Displays the shortcut menu at the current mouse pointer location. If tnMenuMode is 0, the Class Browser form shortcut menu is displayed; if 1, the Class list shortcut menu; if 2, the Member list shortcut menu.

Syntax: DisplayMenu(tnMenuMode)

DoAddIn( )

Executes the specified add-in of the current or specific record of the table with the BROWSER alias.

Syntax: DoAddIn([cAddInName])

FileMatch( )

Compares the specified file against the specified file list to determine if the file is one associated with the add-in.

Syntax: FileMatch(cFileName, cFileList)

ExportClass( )

Generates and displays the definition source code of the selected class or the selected file in the class list.

Syntax: ExportClass([lShow] [, tcExportToFileName])

Arguments

FindClass( )

Finds class text within a class.

Syntax: FindClass([cFind])

FormAddObject( )

Adds an instance of the selected class in the class list to an external form.

Syntax: FormAddObject(oObject [, nXCoord] [, nYCoord] [, lActivateForm] [, lDesignMode][, lNoShow] [, lNoErrors] [, lBuilder] [, oForm])

Arguments

FormatMethods( )

Formats the text of generated methods in the display of the class definition code.

Syntax: FormatMethods(cMethods)

FormatProperties( )

Formats the text of generated properties in the display of the class definition source code.

Syntax: FormatProperties(cProperties [, lAddObjectMode])

GetFile( )

Opens the Class Browser GetFile( ) dialog box. The GetFile( ) method is used internally by the Open or Add buttons in the Class Browser. Whenever the Class Browser prompts for a class library (.vcx) or form (.scx), the GetFile( ) method is called internally.

Syntax: GetFile([cFileExt])

GetTimeStamp( )

Returns the character equivalent of a timestamp value. If no parameter is passed, returns the timestamp string of the currently selected file.

Syntax: GetTimeStamp([ntimestamp])

IndentText( )

Indents a block of text one tab.

Syntax: IndentText(cCode)

IntToBin( )

Returns a string representing a binary value that is the equivalent of an integer value. For example, passing this method a nInteger of 25 would return “11001”.

Syntax: IntToBin([nInteger])

ModifyClass( )

Opens the selected class in the Class Designer.

MsgBox( )

Displays the Class Browser message box. Similar to the Visual FoxPro MESSAGEBOX( ) function.

Syntax: MsgBox(cMessage [, nType] [, cTitle])

NewFile( )

Creates a new class library (.vcx) file. If no parameters are passed, the Open dialog box is displayed. If parameters are provided, a new class library (.vcx) is created and added to the class list in Class Browser.

Syntax: NewFile([cFileName] [, lOpenFile])

OpenFile( )

Opens an existing class library (.vcx) or form (.scx) file. If a file name is not provided, the Open dialog box appears.

Syntax: OpenFile([cFileName])

ProperBaseClass( )

Returns the base class name in the proper case. For example, “combobox” would return as “ComboBox”.

Syntax: ProperBaseClass(cBaseClass)

RedefineClass( )

Changes the parent class of the selected class in the class list.

Syntax: RedefineClass([cAsClass] [, cClassLoc])

RefreshButtons( )

Refreshes the Class Browser command buttons based on the file type.

RefreshClassIcon( )

Reloads the class icon from the icon file.

RefreshClassList( )

Refreshes the class list.

Syntax: RefreshClassList([cDefaultClass] [, lIgnoreTable])

RefreshClassListSubclass( )

For internal use only.

RefreshFileAttrib( )

Refreshes the file attribute status of the file name associated with the selected class in the class list.

RefreshCaption( )

Refreshes the Class Browser caption of a form.

RefreshDescriptions( )

Internal use only. Refreshes the descriptions of classes and members.

RefreshMembers( )

Refreshes the Member tabs to display information associated with the selected class in the class list and, if provided, the specified member.

Syntax: RefreshMembers([tcDefaultMember])

RefreshParentClassBrowser( )

Refreshes the state of the ParentClass Browser toolbar.

RefreshPrefRecNo( )

Refreshes the Browser.dbf preference record pointer for the class library (.vcx) or form (.scx) file being edited.

RefreshRecNo( )

Refreshes the current record pointer of the class library (.vcx) or form (.scx) table for the file of the selected class.

RemoveClass( )

Removes the selected class in the class list from its associated class library (.vcx) file.

Syntax: RemoveClass([lConfirm])

RenameClass( )

Changes the class name of the selected class in the class list.

Syntax: RenameClass([cToClass])

ResetDefaults( )

Restores original display settings. This method is called when you choose Restore Defaults from the shortcut menu.

SavePreferences( )

Saves current preference settings to the Browser.dbf registration table.

ScaleResize( )

Scales the controls on the Class Browser form to fit after the form is resized using the Resize( ) event.

SeekClass( )

Moves the class list pointer to a specific class or index in the class list. Can use the numeric value of the visual position in the class list.

Syntax: SeekClass([cClass][, cClassLibrary])

SeekMember( )

Moves the member list pointer to a specific member.

Syntax: SeekMember(tcMember)

SeekParentClass( )

Displays the parent class of the selected class in the class list.

SetBusyState( )

Sets the lBusyStatus property to true (.T.) or false (.F.) based on the parameter received; also sets the mouse pointer shape to an arrow or hourglass.

Syntax: SetBusyState(lBusyState)

SetFont( )

Sets the font and font size used by the Class Browser for its form, controls, and dialog boxes. If you don’t specify a font name or size, SetFont( ) opens the Get Font dialog box.

Syntax: SetFont([cFontName][, nFontSize][, lFontBold][, lFontItalic])

ShowMenu( )

Displays a menu based on an array. If a menu is a single-dimension array, this method displays a list of all items in your menu. If the array is two-dimensional with an item and an action, it displays the menu items and when the item is selected, it executes the associated action.

Syntax: ShowMenu(aMenu[, cOnSelection])

TrimExt( )

Truncates the file name extension.

Syntax: TrimExt(cFileName [, lPlatformType])

TrimFile( )

Truncates the file name and returns only the file name and path.

Syntax: TrimFile(cFileName [, lPlatformType])

TrimPath( )

Truncates the path name.

Syntax: TrimPath(cFileName [, lTrimExt] [, lPlatformType])

UpdateReferences( )

Used to update references of classes (subclasses and object members) when renaming a class and when moving a class from one class browser to another.

Syntax: UpdateReferences(tcOldClassLoc, tcOldClass, tcNewClassLoc, tcNewClass [, tlAllInstances])

Arguments

VersionCheck( )

Validates the open class library (.vcx) or form (.scx) file.

Syntax: VersionCheck([lShowErrorMsg])

ViewProperty( )

Displays the value of a specific property of the selected class.

Syntax: ViewProperty(cProperty)

WildcardMatch( )

Compares strings for a wildcard match with the filters specified in the Type box.

Syntax: WildcardMatch(cMatchExpList, cExpressionSearched)