Onform_Toolbar Class Properties and Methods

The Onform_Toolbar class is actually not a control class. Itís a container class that contains CommandButtons for each of the toolbar controls. The Onform_Toolbar class allows you to place the Form Toolbar controls directly on a form.

By default a form you create based on the Form_Toolbar class uses the external VPM Enterprise toolbar.

If you want to create a form that puts the toolbar controls directly on the form, do the following:

∑       Create the form based on the Form_Toolbar class or any of its subclasses.

∑       In the Visual FoxPro Form Designer, make room on the form for the On-Form Toolbar.

∑       Make sure that the controls in either the VPMCTRLS.VCX or PROCTRLS.VCX is displayed on the Visual FoxPro Controls Toolbar. Select the OnForm_Toolbar container class on the Controls Toolbar and add it to the form.

∑       Remove the default ďtoolbar_allĒ entry in the formís cToolbar property.

∑       You can then modify the On-Form Toolbar just like the external toolbar.

Properties

The following table lists the class properties. The properties listed include the standard Visual FoxPro class properties that the VPM Enterprise class uses and the VPM Enterprise custom properties. Where appropriate, the Comments column of the table describes a property and provides suggestions for its use.

Property & Initial Value

Comments

Standard Properties Used:

 

BackStyle = 0

 

BorderWidth = 0

 

Height = 22

 

Name = ďonform_toolbarĒ

 

Width = 432

 

Custom Properties:

 

i_cUse_ID = ďĒ

A two-character ID used by the multilingual functionality to provide for the unique translation of a controlís properties.

lListGrid = .F.

The When method of each button sets the property lListGrid to .T. if the active control is a List Grid. Used by the ActivateFirst method.

lUpdateAllow = .T.

Used internally to make sure the Refresh method of the toolbar enables/disables the toolbar buttons at the appropriate time.

nSpecialEffect = 2

In the Init event the setting of this property is transferred to the SpecialEffect property of the controls that are on the toolbar.

Methods

The following table lists the class methods. The methods listed include the standard Visual FoxPro class methods that the VPM Enterprise class uses and the VPM Enterprise custom methods. Where appropriate, the Comments column of the table describes a method and provides suggestions for its use.

Method

Comments

Standard Methods Used:

 

Init

Fills-in the formís oOnFormContainer property that holds the object reference of the toolbar container.

The setting of the nSpecialEffect property is transferred to the SpecialEffect property of the controls that are on the toolbar.

Refresh

Makes sure the active cursor is selected.

Checks the Control Security for each control on the toolbar and sets the ďlAllowĒ properties in the form.

The formís RFParentValue property will not be empty if there is a Related Forms situation in which the formís cursor is the child of another formís cursor. Determines if currently in Parent Mode.

Determines if at end-of-file or beginning-of-file.

Determines if the current record is the first or last record.

Updates the toolbar button properties, enabling and disabling the buttons.

Custom Methods:

 

ActivateFirst

If the active control is a List Grid when one of the toolbar buttons is clicked, activates the page specified in the nSetFocusToFirst property.

DisableControls

When in the ďadd modeĒ, disables all buttons except the Save, Restore and More.

GridListDisable

If the current control is a Grid List, disables certain controls.

SetFocusToGrid

Called by the Click method of toolbar buttons. If editing through a grid, places the focus back on the grid so that the current record can be easily identified.

Toolbar Button Click Methods:

 

cmdParent.Click

Runs the toolbarís (containerís) ActivateFirst method.

Toggles the lRFParentMode form property signifying the Parent Mode on/off status.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdFind.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís Find method that brings up either the Find form or the SQL Find form.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdLocate.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís Locate method that brings up the Locate (Condition Builder) form.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdList.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís List method that brings up the List form.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdFilter.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís Filter method that brings up the Filter (Condition Builder) form.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdOrder.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís Order method that brings up the Order form.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdPrint.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís Print_Toolbar method that brings up the Report Manager, runs a command, or runs a report or label.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdFirst.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís First method that moves the record pointer to the first record in the cursor.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdPrior.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís Prior method that moves the record pointer to the prior record in the cursor.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdNext.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís Next method that moves the record pointer to the next record in the cursor.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdLast.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís Last method that moves the record pointer to the last record in the cursor.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdNew.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís AddNew method that adds a record to the cursor.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) DisableControls method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

cmdCopy.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís Copy method that copies the current record.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) DisableControls method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

cmdDelete.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís Delete method that deletes the current record.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdGroupDelete.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís GroupDelete method that brings up the Filter (Condition Builder) form before deleting records that match the specified criteria.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdMore.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís Save and AddNew methods to save the current record and then add a new record.

If the new record is added:

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) DisableControls method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

If the new record is not added:

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the formís RefreshForm method to redisplay the previous record, the one that was saved.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdSave.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís Save method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the formís RefreshForm method to redisplay the saved record.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdRestore.Click

Runs the toolbarís (containerís) ActivateFirst method.

Runs the formís Restore method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) Refresh method.

Runs the formís EnableDisableToolbarControls method so toolbar controls can be conditionally enabled and disabled.

Runs the toolbarís (containerís) SetFocusToGrid method.

cmdClose.Click

Runs the formís QueryUnload method.

If the QueryUnload method returns .T., runs the formís Release method to close the form.

 

More:

Onform_Toolbar_Edit Class Properties and Methods