AddEditControl (specify custom edit-in-place class) 

Top  Previous  Next

 

AddEditControl( [editclass], column [, autofree] )

AddEditControl

Specifies a custom edit-in-place class for a browse field.

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. A value of one (1) indicates the first column; a two (2) indicates the second column, etc.

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. If omitted, autofree defaults to zero (0).

The AddEditControl 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.

Regarding the column parameter, note that the number is the Fields Number for that column in the listbox. If there are columns with color, icon, or styles, that number will not match the column number. Columns do not need to be specified in the column order and it is not required to have all the columns declared. A column is automatically created by the templates to be edited with a standard entry control if is not specifically added to any EIP class.

 

Implementation:

You do not need to call this method to use the default editclass. If you do not call the AddEditControl method for a browse list column, the BrowseClass automatically instantiates the EditClass declared in ABBROWSE.INC for that column.

The autofree parameter defaults to zero (0). The BrowseClass.Kill method DISPOSEs the editclass objects only if autofree contains a non-zero value.

The BrowseClass.Ask method instantiates the editclass objects as needed, then creates and deletes the edit-in-place control upon the end user's insert or change request.

Example:

INCLUDE('ABBROWSE.INC')               !declare browse & related classes

INCLUDE('MYCOMBO.INC')                !declare custom EIP control class

!other browse class declarations

CODE

MyBrowse.AddEditControl(,1)           !column 1 not editable

MyBrowse.AddEditControl(ComboClass,2) !edit column 2 with combo control

See Also:     Ask ,PROPLIST:FieldNo