BeginEdit

Forms, interaction, edit history

Description

OriginalValue

FocusField The requested Widget is focused first through CommitCurrent with True set to

EditValue, so a previously active edit follows the normal commit, blur and focus action path On success the edit history is reset, DisplayValue and

1 are initialised from the field value and the caret is placed at the end of the value Read-only fields and other field types are rejected, and requesting the Widget that is already focused and being edited returns

Declaration

function BeginEdit(FieldIndex: Integer): Integer;

Parameters

FieldIndexField or temporary Widget index of the editable text or choice field

Return value

Returns 1 when the edit is active, otherwise 0 when the request was reentrant, the field is invalid, read-only or not editable, or focusing failed

Example

if Session.BeginEdit(FieldIndex) = 1 then
  Session.CommitEdit;

See also

CommitEdit, CancelEdit, FocusField, EditingFieldIndex, EditValue, OriginalValue, ClearEditHistory, TPDFlibFormSession