ImageEn, unit imageenview

TIETextEditorEvent


Declaration

TIETextEditorEvent = procedure(Sender: TObject; Layer: integer; Editor: TObject) of object;


Description

Layer is the index of the layer being edited.
Editor is the editing object.
For TIELineLayer it is a TIEEdit.
For TIETextLayer it is a TIERichEdit when EnableFormatting=True. Otherwise it is a TIEEdit.


Example

procedure Tfmain.ImageEnView1ActivateTextEditor(Sender: TObject; Layer: Integer; Editor: TObject);
begin
  // Show Text Editor with Yellow background for Line Layers (always a TIEEdit)
  if ImageEnView1.Layers[ Layer ].Kind = ielkLine then
    TIEEdit( Editor ).Color := clYellow
  else
  // Show Text Editor with Gray background for Text Layers (may be TIERichEdit or TIEEdit)
  if Editor is TIEEdit then
    TIEEdit( Editor ).Color := clGray
  else
  if Editor is TIERichEdit then
    TIERichEdit( Editor ).Color := clGray;
end;