CommandButton_ Class Properties and Methods

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:

 

Caption = “Command”

 

FontBold = .F.

 

FontSize = 9

 

Height = 26

 

Name = “commandbutton_”

 

Width = 75

 

Custom Properties:

 

aValidFilterVariables[1,2]

An array that can be filled with the definition of filter variables that will be set before the validation cursor is created, causing records to be excluded from the cursor. The array is a two-dimensional array that defines the variables used in the WHERE clause of a view or cursoradapter’s SELECT statement. Prior to the cursor being created the variables listed in the array are defined using the name from column 1 and the value from column 2.

cAlias = “”

For data-bound controls whose ControlSource property does not include the cursor alias, the developer should fill-in this property with the alias of field’s cursor. It is used for various purposes, including being passed to the validation routine.

cCSControlID = “”

The two-character ID used to identify the control when setting up Control Security.

cEnabledExpression = “”

Can be filled with an expression that is evaluated by the form’s EnableDisableToolbarControls method as each ISA record is displayed. The result of the evaluation (.T. or .F.) is placed in the form/toolbar control’s Enabled property.

cEnabledOnlyWhenNew Expression = “”

Can be filled with an expression that is evaluated by the form’s EnableDisableControls method when the record that is bound to the control is new. The result of the evaluation (.T. or .F.) is placed in the control’s Enabled property.

cFieldSecurityID = “”

Contains the Field Security ID that is automatically filled-in from the data dictionary in the Init method. Is passed to the When routine to implement view-only Field Security.

cFormAllowProperty = “”

When the button is used in a toolbar, this property is used to identify the name of the form’s “lAllow” property, which is used to disable the button at the form-level and through Control Security.

cLookupFor = “”

For internal use. If the button is a lookup button, contains the name of the related textbox.

cName_DDD = “”

Identifies the DD database/CA library name when different from the database/CA library that can be derived from the alias specified in the ControlSource.

cName_DDF = “”

Identifies the DD field name when different from the field name specified in the ControlSource.

cName_DDTV = “”

Identifies the DD table/view/CA name when different from the table/view/CA alias specified in the ControlSource.

cValidFilterExpression = “”

Can contain a filter expression to be applied to the validation cursor that is used to validate the control’s value.

cValidRulesID = “”

Passed on to field validation business rules methods and DD validation code snippets so that validation logic can be conditional if necessary, based on this value.

cWhenExpression = “”

Contains the When expression that is automatically filled-in from the data dictionary by the Init event. Is passed to the When routine.

i_cUse_ID = “”

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

i_lOverrideCaption = .F.

Used by the multilingual functionality to bypass the translation of the Caption property value.

i_lOverrideDownPicture = .F.

Used by the multilingual functionality to bypass the translation of the DownPicture property value.

i_lOverrideDragIcon = .F.

Used by the multilingual functionality to bypass the translation of the DragIcon property value.

i_lOverrideFont = .F.

Used by the multilingual functionality to bypass the translation of the Font property value.

i_lOverridePicture = .F.

Used by the multilingual functionality to bypass the translation of the Picture property value.

i_lOverrideStatusBarText = .F.

Used by the multilingual functionality to bypass the translation of the StatusBarText property value.

i_lOverrideToolTipText = .F.

Used by the multilingual functionality to bypass the translation of the ToolTipText property value.

lEnableDisableControl = .T.

If .T., means that this control participates in the enabling/disabling of controls by the edit mode.

lEnabledOnlyWhenNew = .F.

If .T., means that the control is only enabled when the record is new, and is disabled after the record has been saved.

lGridOverrideCaption = .F.

If .T., the header caption of the column containing this control will not be overwritten with the grid label (short description) stored in the DD.

lLookupCommandButton = .F.

For internal use. Is set to .T. if the button is a lookup button. The textbox that creates this button sets this property to .T.. If .T., the lookup commandbutton functionality is enabled.

lOverrideFieldSecurity = .F.

If .T., the Field Security functionality will be disabled for this control because the cFieldSecurityID property is not filled in with the ID value stored in the DD.

lOverrideStatusBarText = .F.

If .T., the StatusBarText property value of this control will not be overwritten with the Status Bar Text (Message) stored in the DD.

lOverrideToolTipText = .F.

If .T., the ToolTipText property value of this control will not be overwritten with the ToolTip Text stored in the DD.

lOverrideWhen = .F.

If .T., the cWhenExpression property value of this control will not be overwritten with the When expression stored in the DD.

oActiveForm = .F.

Since controls can be placed on both forms and toolbars, and since calls are made in the methods of this control to methods of the active form, the oActiveForm property will contain the object reference of the active form.

oDDFRecord = .F.

When data is retrieved from an SDATADDF record for this control, the record is saved as an object to this property.

oDDTVRecord = .F.

When data is retrieved from an SDATADDTV record for this control, the record is saved as an object to this property.

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:

 

Click

If the button is a lookup button, sets focus to the associated textbox and runs the routine that brings up the F2 Picklist form.

Destroy

Releases the object references stored in the oActiveForm, oDDFRecord, and oDDTVRecord properties.

Init

Identifies the form associated with this control and places the object reference of the form into the oActiveForm property.

Calls the SetControlProperties method of the active form that fills-in generic control properties.

Finds the SDATADDF and SDATADDTV records for this control and fills-in properties specific to this control, including the oDDFRecord and oDDTVRecord properties.

MiddleClick

If the button is a lookup button, sets focus to the associated textbox.

MouseUp

If the SelectOnEntry property is set to .T., selects the text in the control.

RightClick

If the button is a lookup button, sets focus to the associated textbox.

Valid

Runs the field validation routine for the value returned by the IdentifyValidationValue method (by default the null string).

When

Runs the When routine that returns .T. if this control can receive focus. In determining what value to return, the routine evaluates the When expression from the data dictionary and performs the “Display Only” Field Security check.

Custom Methods:

 

IdentifyActiveForm

Since controls can be placed on both forms and toolbars, and since calls are made in the methods of this control to methods of the active form, this property will contain the object reference of the active form.

IdentifyValidationValue

Called by the Valid event to return the value to be validated. By default, the null string.

More:

CommandButton_Toolbar Class Properties and Methods