Onform_Toolbar_Edit Class Properties and Methods

The Onform_Toolbar_Edit class is a container class that contains CommandButtons for each of the toolbar controls. The Onform_Toolbar_Edit class allows you to place the Form Toolbar controls directly on a form. The OnForm_Toolbar_Edit class is a subclass of the OnForm_Toolbar class.

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_Edit 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:

 

Height = 24

 

Name = ďonform_toolbar_editĒ

 

Width = 456

 

Custom Properties:

None

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:

 

Refresh

Runs the Refresh method of the OnForm_Toolbar class.

Disables the Edit button if in the edit mode or enables the Edit button if not in the edit mode.

Custom Methods:

 

DisableControls

Runs the DisableControls method of the OnForm_Toolbar class.

Disables the Edit button.

Toolbar Button Click Methods:

 

cmdEdit.Click

Sets the lEditModeOn form property to .T., signifying that the form is in edit mode. It then runs the formís EnableDisableControls method to enable controls on the form, and then runs the toolbar Refresh method.

 

 

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

If currently in edit mode:

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

If not currently in edit mode:

Sets the lEditModeOn form property to .T., signifying that the form is in edit mode.

Runs the formís EnableDisableControls method to enable the controls on the 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 formís SetFocusToFirst method to move the focus to the first control in the Tab Order that is to be edited.

Runs the formís WriteBuffer method because some controls, like comboboxes, do not work properly after being enabled until the focus has been moved off and then back.

 

More:

OptionGroup_ Class Properties and Methods