<< Click to display table of contents >> TRichViewEdit |
TRichViewEdit is a control for editing documents with pictures, tables, Delphi controls and hyperlinks.
Unit [VCL/FMX]: RVEdit / fmxRVEdit.
Syntax
TCustomRichViewEdit = class(TCustomRichView)
TRichViewEdit = class(TCustomRichViewEdit)
RichViewEdit does not display or edit its content if it is not linked to RVStyle component via Style property.
The most important property settings can be done in the component editor for TRichView. In Delphi (C++Builder) IDE, right click the RichViewEdit object on the form, choose "Settings" in the context menu.
Some abilities of TRichView are disabled in TRichViewEdit, such as:
▪OnCheckpointVisible event;
▪all features related to hypertext ids:OnRVMouseMove, OnJump, GetJumpPointLocation work only when user presses and holds Ctrl key, if rvtoCtrlJumps in EditorOptions (or if ReadOnly=True).
TObject TPersistent TComponent TControl TWinControl TCustomControl TCustomRVControl TCustomRichViewEdit |
TObject TPersistent TComponent TFmxObject TControl TStyledControl TCustomScrollBox TCustomRVControl TCustomRichViewEdit |
grouped in several categories (some entries can be in several groups)
Inserting items at the position of caret Advanced methods for modifying items |
▪CurItemNo – index of item at the position of caret, OffsetInCurItem – offset of caret in this item;
▪CurItemStyle – style (or type) of the item at the position of caret;
▪CurParaStyleNo – current paragraph style index;
▪CurTextStyleNo – current text style index, see also ActualCurTextStyleNo;
▪EditorOptions – options for editing;
▪ReadOnly disables/enables editing;
▪Modified – all editing methods set it to True.
▪CustomCaretInterval – a blinking interval for a custom caret.
▪AcceptDragDropFormats, AcceptPasteFormats – lists of formats that the editor can accept.
▪DefaultPictureVAlign – alignment for pasted and dropped pictures.
▪ForceFieldHighlight affects highlighting of label items.
▪KeyboardType [FMX] – the type of the virtual keyboard
See also properties for undo/redo.
▪OnChange occurs when the document is changed;
▪OnCheckStickingItems allows to add additional text protection;
▪OnCurParaStyleChanged occurs when the index of the current paragraph style is changed;
▪OnCurTextStyleChanged occurs when the index of the current text style is changed;
▪OnPaste allows pasting data from the Clipboard in custom formats;
▪OnStyleConversion occurs while executing ApplyStyleConversion;
▪OnParaStyleConversion occurs while executing ApplyParaStyleConversion;
▪OnCaretGetOut occurs when the user moves the caret "outside" the editor;
▪OnCaretMove occurs when the caret is moved;
▪OnItemTextEdit occurs when a text item's text is changed as a result of editing operation;
▪OnSmartPopupClick occurs when user clicks a "smart popup" button.
▪OnDrawCurrentLine allows to highlight the current line
▪OnMeasureCustomCaret and OnDrawCustomCaret allow drawing your own caret instead of the system one.
▪OnOleDragEnter, OnOleDragOver, OnOleDragLeave, OnOleDrop, OnBeforeOleDrop and OnAferOleDrop occur on OLE drag&drop.
▪ApplyParaStyle, ApplyTextStyle apply paragraph and text style to the selection;
▪ApplyStyleConversion applies custom style conversion to the selected text;
▪ApplyParaStyleConversion applies custom paragraph style conversion to the selected paragraphs;
▪Change generates OnChange event;
▪BeginUpdate, EndUpdate disable and enable redrawing;
▪SearchText, -A, -W search for substring;
▪MoveCaret moves the caret in the specified direction.
▪InsertText, -A, -W, InsertStringTag, InsertStringATag, InsertStringWTag insert text;
▪InsertBreak inserts break (horizontal line);
▪InsertBullet inserts bullet;
▪InsertControl inserts Delphi control;
▪InsertHotspot inserts hotspot;
▪InsertPicture inserts picture;
▪InsertHotPicture inserts picture-hypertext link;
▪InsertTab inserts tabulator;
▪InsertRVFFromFileEd, InsertRVFFromStreamEd insert RVF (RichView Format) from a file or a stream;
▪InsertHTMLFromFileEd, InsertHTMLFromStreamEd insert HTML from a file or a stream;
▪InsertRTFFromFileEd, InsertRTFFromStreamEd insert RTF (Rich Text Format) from a file or a stream;
▪InsertTextFromFile,InsertOEMTextFromFile,InsertTextFromFileW insert text from a file;
▪nsertMarkdownFromFileEd,InsertMarkdownFromStreamEd insert Markdown from a file or a stream;
▪InsertItem – general method for inserting items, inserts one item (usually used for tables).
Main methods and events:
▪CanPaste – "can something be pasted from the Clipboard?";
▪CanPasteRVF – "can RVF (RichView Format) be pasted from the Clipboard?";
▪CanPasteHTML – "can HTML be pasted from the Clipboard?";
▪CanPasteRTF – "can RTF (Rich Text Format) be pasted from the Clipboard?";
▪CutDef cuts selection to the Clipboard;
▪Paste pastes from the Clipboard;
▪PasteBitmap pastes bitmap from the Clipboard;
▪PasteMetafile pastes metafile from the Clipboard;
▪PasteGraphicFile pastes metafile from the Clipboard;
▪PasteRVF pastes RVF (RichView Format) from the Clipboard;
▪PasteHTML pastes RTF (Rich Text Format) from the Clipboard;
▪PasteRTF pastes RTF (Rich Text Format) from the Clipboard;
▪PasteTextA pastes ANSI text from the Clipboard;
▪PasteTextW pastes Unicode text from the Clipboard;
▪event OnPaste allows to paste data from the Clipboard in custom formats.
Also:
▪DeleteSelection deletes selection;
▪SelectCurrentWord selects word at the position of caret;
▪SelectCurrentLine selects the line containing caret.
Main methods:
▪SetBreakInfoEd – for changing break;
▪SetBulletInfoEd – for changing bullet;
▪SetControlInfoEd – for changing inserted control;
▪SetHotspotInfoEd – for changing hotspot;
▪SetPictureInfoEd – for changing picture or hot picture.
Also:
▪SetItemExtraIntProperty[Ex]Ed,
SetItemExtraStrProperty[Ex]Ed – for changing additional properties of items;
▪SetItemTagEd – for changing tag;
▪SetItemVAlignEd – for changing item position relative to the line;
▪SetItemTextEd changes text (name) of item;
▪SetCheckpointInfoEd – for changing checkpoint;
▪RemoveCheckpointEd – for deleting checkpoint;
▪ResizeControl – for resizing inserted control;
▪AdjustControlPlacement returns control to the proper position;
▪AdjustControlPlacement2 returns control to the proper position.
These methods are equivalent to Get***Info(CurItemNo,...) but work also in inplace editors of tables.
Main methods:
▪GetCurrentTextInfo – about text item;
▪GetCurrentBreakInfo – about break;
▪GetCurrentBulletInfo – about bullet;
▪GetCurrentControlInfo – about inserted control;
▪GetCurrentHotspotInfo – about hotspot;
▪GetCurrentPictureInfo – about picture or hot picture;
▪GetCurrentItem – as an object about any item (usually for tables);
Also:
▪GetCurrentItemExtraIntProperty[Ex],
GetCurrentItemExtraStrProperty[Ex] return value of additional item property;
▪GetCurrentTag returns item's tag;
▪GetCurrentItemVAlign returns item position relative to the line;
▪GetCurrentCheckpoint returns item's checkpoint;
▪GetCurrentItemText returns text/name of item;
▪GetCurrentLineCol returns line and column at the caret position.
These methods are equivalent to Set***InfoEd(CurItemNo,...) but work also in inplace editors of tables.
Main methods:
▪SetCurrentBreakInfo modifies break;
▪SetCurrentBulletInfo modifies bullet;
▪SetCurrentHotspotInfo modifies hotspot;
▪SetCurrentControlInfo modifies inserted control;
▪SetCurrentPictureInfo modifies picture or hot picture.
Also:
▪SetCurrentItemExtraIntProperty[Ex],
▪SetCurrentItemExtraStrProperty[Ex] change value of additional item property;
▪SetCurrentTag modifies item's tag;
▪SetCurrentItemVAlign changes item position relative to the line;
▪SetCurrentItemText changes text (name) of item;
▪SetCurrentCheckpointInfo modifies checkpoint;
▪RemoveCurrentCheckpoint deletes checkpoint;
▪ResizeCurrentControl returns control to the proper position in document;
▪RemoveCurrentPageBreak removes "explicit page break before item" flag;
▪InsertPageBreak sets "explicit page break before item" flag; can split current item into two parts.
Methods:
▪ApplyStyleTemplate, ApplyTextStyleTemplate, ApplyParaStyleTemplate apply the specified style template to the selection;
▪ChangeStyleTemplates allows changing the collection of style templates as an editing operation.
Main:
▪property UndoLimit sets capacity of undo buffer;
▪UndoAction returns which operation will be undone next;
▪Undo undoes the last operation;
▪UndoName returns name of custom undo operation which will be undone next;
▪RedoAction returns which operation will be redone next;
▪Redo redoes the last undone operation;
▪RedoName returns name of custom redo operation which will be redone next;
▪ClearUndo clears undo and redo buffers.
Undo grouping:
Alternative undo grouping:
▪BeginUndoGroup2, EndUndoGroup2;
▪BeginUndoCustomGroup2, EndUndoCustomGroup2.
▪PasteTextW pastes Unicode text from the Clipboard;
▪InsertTextW inserts Unicode text;
▪InsertTextFromFileW inserts Unicode text from file.
▪GetCurrentMisspelling returns misspelled word at the caret position;
▪[FMX] AddSpellingMenuItems adds spelling check suggestions to a popup menu;
▪property LiveSpellingMode controls when live spelling thread starts;
▪[FMX] event OnGetSpellingSuggestions requests a list of possible corrections for a misspelled word.
"Smart popups" are buttons that can be used to set properties for the current (at the position of caret) item.
Properties:
▪SmartPopupProperties – popup button properties;
▪SmartPopupVisible – popup button properties.
Events:
▪OnSmartPopupClick occurs when user clicks "smart popup" button.
▪InsertItem – general method for inserting items, inserts one item (usually used for tables, labels, sequences, footnotes, endnotes, references to notes).
▪GetCurrentItem returns item at the position of caret as an object (usually used for tables, labels, sequences, footnotes, endnotes, references to notes);
▪BeginItemModify, EndItemModify are used to reformat editor after operations on item (usually on tables);
▪CanChange checks possibility of performing editing operation (usually it is called before making operations on table).
Editing-style analogs of methods of TRichView:
▪SetCheckpointInfoEd – adds checkpoint for the specified item;
▪RemoveCheckpointEd – deletes checkpoint for the specified item.
Methods working with the item at the position of caret:
▪GetCurrentCheckpoint – returns checkpoint associated with the item at the caret position;
▪SetCurrentCheckpointInfo – adds/modifies checkpoint for the item at the caret position;
▪RemoveCurrentCheckpoint – deletes checkpoint for the item at the caret position.
Methods working with the checkpoint exactly at the position of caret:
▪InsertCheckpoint – inserts checkpoint in the caret position;
▪GetCheckpointAtCaret – returns the checkpoint exactly at the caret position;
▪RemoveCheckpointAtCaret – deletes the checkpoint exactly at the caret position.
Events:
▪OnSaveCustomFormat allows saving data in DB field in custom formats