ImageEn, unit imageenview |
|
TImageEnView.OnActivateTextEditor
Declaration
property OnActivateTextEditor: TIETextEditorEvent;
Description
Occurs whenever a text editor is activated for a
TIETextLayer,
TIELineLayer or
text object when
editing a PDF.
Note:
◼Index will be >= 2,000,000,000 when editing a
text annotation of a PDF
◼Index will be >= 1,000,000,000 when editing a
text object of a PDF
procedure TForm1.ImageEnView1ActivateTextEditor(Sender: TObject; Index: Integer; Editor: TObject);
const
PDFIUM_OBJECT_INDEX = 1000000000;
PDFIUM_ANNOTATION_INDEX = 2000000000;
begin
// Ensure it is not a PDF object/Annotation
if Index >= PDFIUM_OBJECT_INDEX then
exit;
// Show Text Editor with Yellow background for Line Layers (always a TIEEdit)
if ImageEnView1.Layers[ Index ].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;
See Also
◼OnDeactivateTextEditor
◼TIETextLayer.ActivateEditor
◼TIELineLayer.ActivateEditor
◼TIEPdfViewer.ActivateEditor