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 the caret, OffsetInCurItem – offset of the caret in this item;

CurItemStyle – style (or type) of the item at the position of caret;

CurParaStyleNo – index of the current paragraph style;

CurTextStyleNo – index of the current text style, 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 adding 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 a paragraph or a text style to the selection;

ApplyStyleConversion applies a custom style conversion to the selected text;

ApplyParaStyleConversion applies a custom paragraph style conversion to the selected paragraphs;

Change generates OnChange event;

BeginUpdate, EndUpdate disable and enable redrawing;

SearchText, -A, -W search for a 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 a break (horizontal line);

InsertBullet inserts a bullet;

InsertControl inserts a Delphi control;

InsertHotspot inserts a hotspot;

InsertPicture inserts a picture;

InsertHotPicture inserts a picture-hypertext link;

InsertTab inserts a 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 an image (usually bitmap) from the Clipboard;

PasteMetafile pastes a metafile from the Clipboard;

PasteGraphic pastes an image (by MIME-type) from the Clipboard;

PasteGraphicFile pastes an image from file from the Clipboard;

PasteRVF pastes RVF (RichView Format) from the Clipboard;

PasteHTML pastes HTML from the Clipboard;

PasteRTF pastes RTF (Rich Text Format) from the Clipboard;

PasteText pastes text from the Clipboard;

PasteMarkdown pastes text from the Clipboard as Markdown;

event OnPaste allows pasting data from the Clipboard in custom formats.

Also:

DeleteSelection deletes the selection;

SelectCurrentWord selects the word at the position of the caret;

SelectCurrentLine selects the line containing the caret.

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

Main methods:

SetBreakInfoEd – for changing a break;

SetBulletInfoEd – for changing a bullet;

SetControlInfoEd – for changing an inserted control;

SetHotspotInfoEd – for changing a hotspot;

SetPictureInfoEd – for changing a picture or a 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, AdjustControlPlacement2 return 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 a break;

SetCurrentBulletInfo modifies a bullet;

SetCurrentHotspotInfo modifies a hotspot;

SetCurrentControlInfo modifies an inserted control;

SetCurrentPictureInfo modifies a picture or a hot picture.

Also:

SetCurrentItemExtraIntProperty[Ex],

SetCurrentItemExtraStrProperty[Ex] change value of additional item property;

SetCurrentTag modifies item's tag;

SetCurrentItemVAlign changes the item position relative to the line;

SetCurrentItemText changes a text (name) of the item;

SetCurrentCheckpointInfo modifies a checkpoint;

RemoveCurrentCheckpoint deletes a checkpoint;

ResizeCurrentControl resizes a control;

 

RemoveCurrentPageBreak removes the "explicit page break before item" flag;

InsertPageBreak sets the "explicit page break before item" flag; can split the 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 the undo buffer;

UndoAction returns which operation will be undone next;

Undo undoes the last operation;

UndoName returns the name of the custom undo operation which will be undone next;

RedoAction returns which operation will be redone next;

Redo redoes the last undone operation;

RedoName returns the name of the custom redo operation which will be redone next;

ClearUndo clears the 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 a file.

Live Spelling Check

GetCurrentMisspelling returns the misspelled word at the caret position;

[FMX] AddSpellingMenuItems adds spelling check suggestions to a popup menu;

property LiveSpellingMode controls when the live spelling thread starts;

[FMX] event OnGetSpellingSuggestions requests a list of possible corrections for the misspelled word.

"Smart Popups"

"Smart popups" are buttons that can be used to set properties for the current (at the position of the caret) item.

Properties:

SmartPopupProperties – popup button properties;

SmartPopupVisible – shows/hides the popup button.

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 an operations on an item (usually on tables);

CanChange checks whether the editing operation can be performed (usually it is called before making operations on a table).

Working with Checkpoints

Editing-style analogs of methods of TRichView:

SetCheckpointInfoEd adds a checkpoint for the specified item;

RemoveCheckpointEd deletes the checkpoint for the specified item.

Methods working with the item at the position of caret:

GetCurrentCheckpoint – returns the checkpoint associated with the item at the caret position;

SetCurrentCheckpointInfo – adds/modifies a checkpoint for the item at the caret position;

RemoveCurrentCheckpoint – deletes the checkpoint for the item at the caret position.

Methods working with the checkpoint exactly at the position of caret:

InsertCheckpoint – inserts the 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