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

 

Century = 2

 

FontBold = .F.

 

FontName = “Courier New”

 

FontSize = 9

 

Format = “K”

 

Height = 20

 

Margin = 0

 

Name = “textbox_”

 

Width = 100

 

Custom Properties:

 

aPicklistFilterVariables[1,2]

An array that can be filled with the definition of filter variables that will be set before the Picklist 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.

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.

cFindForm_SQL = “find_sql”

Contains the name of the SQL Find form or form class. The SQL Find form is brought up prior to the Picklist form being brought up to allow the user to filter the records that appear in the Picklist cursor.

cFindForm_SQL_AltCaptions = “”

When the SQL Find form is used, specifies captions to be used on the Find form (semi-colon delimited list) instead of captions from the data dictionary. The captions should be entered into the property in the order in which the associated parameters (Find<field name> variables) will be displayed on the Find form. Captions can be entered selectively, meaning that only those captions that should be different than the captions that would be used by default from the data dictionary need to be specified.

cFindForm_SQL_ClassLibrary = “progen”

Contains the name of the class library that contains the SQL Find form class if cFindForm_SQL contains the name of a form class.

cFKUpdate_FKFields = “”

Contains a comma-delimited list of fields that will be replaced with lookup cursor PK values from the new record that is created through the lookup cursor editing form.

cFKUpdate_Form = “”

Contains the name of the lookup cursor editing form.

cFKUpdate_PKFields = “”

Contains a comma-delimited list of PK fields in the new lookup cursor record whose values will be used to replace FK fields in the current record.

cListTag = “”

Used by the List Grid Builder to store the name of the tag to use when performing an incremental search on the column that contains this textbox.

cLookupAlias = “”

If the lLookupDescription property is set to .T., this property can be used to identify the alias of the lookup cursor. If blank, the lookup cursor will be found by searching the cursors in the DE.

cLookupDDDName = “”

Contains the name of the database or cursoradapter library that contains the table, view, or cursoradapter specified in the cLookupDDTVName property.

cLookupDDTVName = “”

The lookup cursor that is used to display the lookup description does not have to be opened through the DE. The Init method of the control will open the lookup cursor if this property contains the name of the table, view, or cursoradapter. If a table, the extension must be included. Also, the cLookupAlias property must contain the alias that will be assigned to the cursor.

cLookupExpression = “”

Contains the expression that defines what is displayed from the lookup cirsor record when the lLookupDescription property is set to .T..

cLookupFKExpression = “”

Contains the expression used to determine the value used when finding the lookup cursor record.

cLookupPicture = “”

Can be used to specify a bitmap to be used by the lookup button instead of the default bitmap lookup.bmp.

cLookupPKTag = “”

Contains the name of the tag to be used when finding a lookup cursor record.

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.

cPicklistFilterExpression = “”

Can contain a filter expression to be applied to the Picklist cursor.

cPicklistID = “”

Allows for the specification of the Picklist definition to be used when the Picklist form is brought up. If empty, the default Picklist definition will be used. Otherwise, a Picklist ID can be entered that matches the desired Picklist ID as entered in the Picklist Builder.

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

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

cSaveControlSource = “”

If displaying a description from a lookup cursor (lLookupDescription = .T.), this property will hold the ControlSource of the field to which the control is bound.

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

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

KeyPressResetValue = “”

See the comments for lKeyPressReset property.

lAddLookupCommandButton = .T.

The addition of a lookup button can be turned off by setting this property to .F..

lAddLookupOnFocus = .F.

By default, the lookup button is added when the textbox is instantiated. If this property is set to .T., the lookup button is not visible until the textbox receives focus, and becomes invisible again when the textbox loses focus.

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.

lFindForm_SQL = .F.

The Picklist cursor specified for a FK in the Picklist Builder can use the Find<field name> filter variables to limit the records that will populate the Picklist cursor. This property, when set to .T., will cause the SQL Find form to be run before the Picklist form is run. The SQL Find form accepts filter variable values and repopulates the Picklist cursor. The control also has the properties cFindForm_SQL, cFindForm_SQL_AltCaptions, and lFindForm_SQL_NoEntriesOK that provide the same control over the SQL Find form that properties of the same names at the form level provide over the SQL Find form that is brought up through the Find button on the toolbar.

lFindForm_SQL_NoEntriesOK = .F.

When the SQL Find form is used with this control, specifies whether the user can leave all filter variables empty. Doing so causes the Picklist cursor to contain all records.

lFKUpdateOneAdd = .F.

If .T. and the Add New option on the right-click menu or the Add button on the F2 Picklist form is clicked, the Picklist cursor editing form is automatically closed after the initial new record is saved or cancelled.

lFKUpdateRequeryView = .T.

Set to .T. when the Add New or Edit option on the right-click menu or the Add or Edit button on the F2 Picklist form is clicked. This causes the requery/refresh of the FK field’s lookup cursor upon form reactivation.

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.

lKeyPressReset = .T.

If .T. (the default), and the user presses the reset key or key combination (the Delete key by default, as defined by the properties nKeyPressReset_KeyCode and nKeyPressReset_ShiftAltCtrl), the value in the KeyPressResetValue property is placed in the Value property of this control. This allows for the resetting of the field value when the field value is not edited directly, like when a description from a lookup cursor is displayed instead of the field value.

lListCalc = .F.

For internal use. Used by the List Grid Builder to identify columns whose ControlSource is a calculated value.

lLookupDescription = .F.

If .T., the control will display a description from the lookup cursor instead of the value in the field.

lLookupInGrid = .F.

Is set to .T. when the lookup description textbox is in a grid column.

lLostFocusForLookup = .F.

For internal use. Is used to make sure the lookup command button is not made invisible at the wrong time.

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.

lOverrideInputMask = .F.

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

lOverrideWidth = .F.

If you do not want the width of the control to be adjusted to match the field width as stored in the data dictionary, set lOverrideWidth to .T..

lPicklist = .T.

If .T., will enable the F2 Picklist when the field that is bound to this control is validated using Set or Referential type Integrity.

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.

lValidatedForLookup = .F.

Used internally to prevent the validation routine from running if the Valid event was fired because the lookup button was clicked.

nKeyPressReset_KeyCode = 7

Along with the nKeyPressReset_ShiftAltCtrl property value defines the Reset key. The key that when pressed causes the Value property value to be reset. See the INKEY() topic in the VFP help file for a definition of valid values for this property and the nKeyPressReset_ShiftAltCtrl property. Also see the comments for lKeyPressReset property for more information.

nKeyPressReset_ShiftAltCtrl = 0

See the comments for nKeyPressReset_KeyCode property.

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

Contains a workaround for an error that occurred (#45 - Not a character expression) when a textbox was clicked or double-clicked on either the Find or SQL Find form.

DblClick

Contains a workaround for an error that occurred (#45 - Not a character expression) when a textbox was clicked or double-clicked on either the Find or SQL Find form.

Destroy

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

GotFocus

Makes the lookup command button visible if lAddLookupOnFocus is set to .T..

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.

Adjusts the width of the control based on the font settings.

Creates the cursor, if necessary, from which the lookup description is displayed.

KeyPress

Prevents the entering of a backspace from moving the focus off the control.

LostFocus

Makes the lookup command button invisible if lAddLookupOnFocus is set to .T..

MouseUp

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

Refresh

If the textbox is being used to display a description from a lookup cursor, finds/retrieves the record and displays the description.

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 Value property of 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 Value property of the control is returned.

PicklistFKUpdate

If a selection is made on the Picklist form, the PK value of the selected record is placed into the FK field(s) or FK control(s) (if not data-bound) on the active form. This method is called prior to the replacement of the FK values. If the method returns .T. (the default), the replacement occurs. If the method returns .F., the replacement does not occur.

 

More:

Textbox_Output Class Properties and Methods