AddControl (register edit-in-place controls) 

Top  Previous  Next

 

AddControl([EditClass], Column, AutoFree)

AddControl

Specifies an edit-in-place control.

EditClass

The label of the EditClass. If omitted, the specified column is not editable.

Column

An integer constant, variable, EQUATE, or expression that indicates the browse list column to edit with the specified editclass object.

AutoFree

A numeric constant, variable, EQUATE, or expression that indicates whether the BrowseClass.Kill method DISPOSEs of the editclass object. A zero (0) value leaves the object intact. A non-zero value DISPOSEs the object.

The AddControl method specifies the EditClass that defines the edit-in-place control for the browse column. Use autofree with caution; you should only DISPOSE of memory allocated with a NEW statement. See the Language Reference for more information on NEW and DISPOSE.

The AddControl method also registers fields which will not be editable via edit-in-place. In this instance the EditClass parameter is omitted.

Implementation:

The InitControls and BrowseClass.AddEditControl methods call the AddControl method. The BrowseClass.AddEditControl method defines the editclass for a column not utilizing the default editclass.

The AddControl method ADDs a record containing the values of EditClass, Column, and AutoFree, to the EditQueue which is declared in ABEdit.INC as follows:

EditQueue     QUEUE,TYPE

Field        UNSIGNED

FreeUp        BYTE

Control       &EditClass

                    END

Example:

BrowseClass.AddEditControl PROCEDURE(EditClass EC,UNSIGNED Id,BYTE Free)

 CODE

   SELF.CheckEIP

   SELF.EIP.AddControl(EC,Id,Free)

 

See Also     EQ, InitControls, BrowseClass.AddEditControl