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

 

ColorScheme = 1

 

DisabledForeColor = 0,0,0

When control is disabled, this color allows the text to be more easily read.

FontBold = .F.

 

FontSize = 9

 

Height = 100

 

Margin = 0

 

Name = “editbox_”

 

Width = 200

 

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.

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.

cRightClick_Menu = “S”+_SCREEN.oApp.cCurPre+ ”FEDT.MPR”

The name of the right-click shortcut menu to be run.

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_lOverrideControlSource = .F.

Used by the multilingual functionality to bypass the translation of the ControlSource 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_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.

lNoCR = .F.

If .T., the KeyPress event prevents the Enter key from being pressed, which prevents a carriage return from being inserted into the field/control.

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.

lOverrideFormat = .F.

If .T., the Format property value of this control will not be overwritten with the Format 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.

lSelectByMouse = .F.

Used internally to provide the functionality whereby if the SelectOnEntry property is set to .T. and this control is clicked on, the text in the control is selected.

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:

 

Destroy

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

GotFocus

Stores the current MDOWN() status in the lSelectMouse property. See the comments for the lSelectMouse property for more information.

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.

InteractiveChange

If the Format property contains an exclamation point (!), forces the text in the Value property to upper case.

KeyPress

If the lNoCR property is set to .T., prevents the Enter key from being pressed, which prevents a carriage return from being inserted into the field/control.

MouseUp

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

RightClick

Runs the menu specified in the cRightClick_Menu property.

Valid

Runs the field validation routine for the value returned by the IdentifyValidationValue method (by default the value in the field bound to this control).

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 value in the field bound to this control is returned. If the field is empty a .F. value is returned, which causes the field validation routine to not be run.

If the Format property contains a “T” or “t”, trims leading and trailing spaces as well as trailing carriage returns.

 

More:

Grid_ Class Properties and Methods