richviewedit TRichViewEdit

Properties   Methods   Events

<< Click to display table of contents >>

richviewedit TRichViewEdit

Properties   Methods   Events

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).

Hierarchy

hmtoggle_arrow1Hierarchy (VCL and LCL)

hmtoggle_arrow1Hierarchy (FireMonkey)

List of properties, events and methods

grouped in several categories (some entries can be in several groups)

DOWN Properties

DOWN Events

DOWN General methods

DOWN Inserting items at the position of caret

DOWN Clipboard operations

DOWN Advanced methods for modifying items

DOWN Information about item at the position of caret

DOWN Modifying item at the position of caret

DOWN Style templates

DOWN Undo/Redo

DOWN Unicode

DOWN Live spelling check

DOWN "Smart Popups"

DOWN Related to tables and special items

DOWN Working with checkpoints

DOWN LiveBindings and DB

Properties

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.

Events

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.

General Methods

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.

Inserting Items at the position of Caret (Insert*** methods)

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).

Clipboard Operations

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.

Advanced Methods for Modifying Items (Set***InfoEd methods)

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.

Information about the Item at the Position of Caret (GetCurrent***Info methods)

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);

GetCurrentItemEx.

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.

Modifying Item at Position of Caret (SetCurrent***Info methods)

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.

Style templates

Methods:

ApplyStyleTemplate, ApplyTextStyleTemplate, ApplyParaStyleTemplate apply the specified style template to the selection;

ChangeStyleTemplates allows changing the collection of style templates as an editing operation.

Undo/Redo

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:

BeginUndoGroup,

BeginUndoCustomGroup,

SetUndoGroupMode.

Alternative undo grouping:

BeginUndoGroup2, EndUndoGroup2;

BeginUndoCustomGroup2, EndUndoCustomGroup2.

Unicode

PasteTextW pastes Unicode text from the Clipboard;

InsertTextW inserts Unicode text;

InsertTextFromFileW inserts Unicode text from file.

Live Spelling Check

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"

"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.

Related to Tables and Special Items

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).

Working with Checkpoints

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.

LiveBindings and Databases

Events:

OnSaveCustomFormat allows saving data in DB field in custom formats