rvico TRichView Reference | TRichViewEdit

RichViewEdit TRichViewEdit

Properties   Methods   Events

Top  Previous  Next

TRichViewEdit is a control for editing documents with pictures, tables, Delphi controls and hyperlinks.

Unit RVEdit

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, GetJumpPointItemNo work only when user presses and holds  Ctrl  key, if rvtoCtrlJumps in EditorOptions (or if ReadOnly=True).

Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TRVScroller

TCustomRichView

TCustomRichViewEdit

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 in 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

Properties

CurItemNo – index of item in 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.

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.

OnMeasureCustomCaret and OnDrawCustomCaret allow drawing your own caret instead of the system one.

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.

Inserting Items in 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 file or stream;

InsertRTFFromFileEd, InsertRTFFromStreamEd insert RTF (Rich Text Format) from file or stream;

InsertTextFromFile,InsertOEMTextFromFile,InsertTextFromFileW insert text from file;

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?";

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;

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]Edfor changing additional properties of items;

SetItemTagEdfor changing tag;

SetItemVAlignEdfor changing item position relative to the line;

SetItemTextEd  changes text (name) of item;

SetCheckpointInfoEdfor changing checkpoint;

RemoveCheckpointEdfor deleting checkpoint;

ResizeControlfor 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:

GetCurrentTextInfoabout text item;

GetCurrentBreakInfoabout break;

GetCurrentBulletInfoabout bullet;

GetCurrentControlInfoabout inserted control;

GetCurrentHotspotInfoabout hotspot;

GetCurrentPictureInfoabout picture or hot picture;

GetCurrentItemas 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 in 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.

Also:

BeginUndoGroup,

BeginUndoCustomGroup,

SetUndoGroupMode.

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;

property LiveSpellingMode controls when live spelling thread starts.

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


TRichView © trichview.com