ImageEn, unit iemview

TIEEditTextEvent


Declaration

TIEEditTextEvent = procedure(Sender: TObject; Index: Integer; Position: TIEMTextPos; var Text: String; var Allow: boolean) of object;


Description

Used by OnEditText whenever the user renames text of an image (when ReadOnly = False).

Index and Position specify the image being edited, and which of its text fields.
Text specifies the new value for the field. Set Allow to false to block the change (editor will not be disabled).

Note: Setting Allow keeps the editor active (does not hide). To hide the editor, but prevent the change, reset Text to the old value of the field.


Example

procedure TMyForm.IEMView1EditText(Sender: TObject; Index: Integer; Position: TIEMTextPos; var Text: String; var Allow: boolean);
begin
  // Do not allow user to specify colons or slashes
  if ( pos( ':', Text ) > 0 ) or ( pos( '\', Text ) > 0 ) then
  begin
    Allow := False;
    MessageBeep( MB_ERROR );
  end;
end;