New in version 18

<< Click to display table of contents >>

New in version 18

This topic includes changes of v17.3 and newer.

Compatibility issues

Methods for compatibility with ancient versions of TRichView are removed.

Redundant TRichView.Add*** methods are marked as deprecated. Only a single method for each item type is recommended. These methods have optional parameters. For example, use AddBreak instead of AddBreakEx, AddBreakTag, AddBreakExTag.

All String, TRVRawByteString, TRVAnsiString properties and parameters of methods and events are changed to TRVUnicodeString, where it is possible.

Changed events:

In TRichView: OnAssignImageFileName, OnImportPicture, OnItemAction, OnItemHint, OnReadHyperlink, OnRVDblClick, OnRVRightClick, OnRVFControlNeeded, OnRVFPictureNeeded, OnSaveComponentToFile, OnSaveDocXExtra, OnSaveHTMLExtra, OnSaveImage2, OnSaveItemToFile (additionally, Unicode: Boolean parameter is removed), OnSaveParaToHTML, OnSaveRTFExtra, OnSpellingCheck, OnWriteHyperlink

In TRichViewEdit: OnDropFile, OnItemTextEdit

In TRVStyle: OnDrawStyleText (see also below)

A new PSaD parameter is added to custom drawing events of TRVStyle component. Additionally, since this version, text is drawn relative to its base line. These change may affect your existing custom drawing code. Also, parameters are added to:

In TRVStyle: OnDrawStyleText (Baseline and PSaD), OnApplyStyle (PSaD)

In TFontInfo: Draw (Baseline and PSaD)

If you used these events in your application, you need to change types of parameters manually. Since TRVUnicodeString is defined in RVTypes unit, make sure that this unit is listed in "uses" of your forms.

In OnSaveDocXExtra, with Area = rv_docxs_ParaStyle, the meaning of Obj parameter is changed (now it contains an RVData instead of a paragraph style).

Many var-parameters of methods were changed to out-parameters. This change should not affect your projects unless you developed classes inherited from TRichView classes.

Controls loaded from RVF are now scaled from RVF PPI ("pixels per inch") to the actual PPI. Controls in RVF files saved by older versions of TRichView are not scaled (unless you change value of DefaultRVFPixelsPerInch), however, the actual PPI is assigned to their Font.PixelsPerInch.

RichViewPixelsPerInch global variable and TRVStyle.TextStyles.PixelsPerInch are deprecated. Use TRichView.DocumentPixelsPerInch and TRVStyle.UnitsPixelsPerInch.

TRVStyle.GetAsPixels, TRVStyle.PixelsToUnits, and functions for unit conversions have additional parameters.

Sizes measured in pixels now use TRVStyle.UnitsPixelsPerInch instead of Screen.PixelsPerInch. This change affects some code, e.g. the example in RV_GetPrinterDC;

Lazarus

TRichView is compatible with Lazarus (32-bit and 64-bit Windows targets)

RAD Studio 10.3 Rio

TRichView is compatible with Delphi and C++Builder 10.3 Rio.

Complete support for multiple monitors having different PPI ("per monitor v2").

Unicode

Since this version, all text is stored in our components as Unicode, for all versions of Delphi. All string properties and parameters are made Unicode, when possible.

Because of this change, some properties became obsolete. They are not removed, but do nothing:

TFontInfo.Unicode

TRVStyle.DefUnicodeStyle

TRVRTFReaderProperties.UnicodeMode

New features related to Unicode:

support for Unicode characters having codes greater than $FFFF

support for pasting and drag&dropping of Unicode URLs

entering a character by pressing and holding  Alt  and typing decimal character code on the numeric keypad, starting from '0' ( Num Lock  must be on); this feature can be turned off, if you include rvoAlt0CodesUseKeyboardCodepage in EditorOptions

entering a character by typing its hexadecimal code (directly in the editor) and then pressing  Alt  +  X . Pressing  Alt  +  X  again converts it back to a hexadecimal number.

Measure units, zooming, high DPI

New measure unit is added to TRVStyleUnits: EMU (English metric unit).

You can define DPI for all values measured in pixels in TRVStyle.UnitsPixelsPerInch. With this property, pixels become independent of the screen DPI, like twips and EMU. When displaying on the screen, all pixel sizes are scaled from UnitsPixelsPerInch, including image sizes (the only exceptions are controls and images from image lists).

High DPI display modes are supported completely.

If application supports monitors having different DPI (in Delphi 10.1+), TRichView uses DPI of its monitor. "Per monitor v2" is supported in Delphi 10.3.

You can change document DPI using TRichView.DocumentPixelsPerInch property. This property allows to implement zooming.

Editing

A new (alternative) way to group editing operations for undo: BeginUndoGroup2..EndUndoGroup2 (or BeginUndoCustomGroup2..EndUndoCustomGroup2). These methods allow grouping operations in several table cells.

New events

TRichView.OnReadMergeField allows reading merge fields from RTF.

Text drawing

All text is drawn relative to its base line. Previously, by default, it was drawn relative to its top left corner. New drawing produces better result for scaled text (in TRVPrintPreview or in ScaleRichView). This change affected TRVStyle.OnDrawStyleText event and TFontInfo.Draw method, see the compatibility issues above.

Saving and loading

RVF

loading graphic from RVF even if the specified graphic class is not available (or not registered): the proper graphic class is chosen by the graphic content. New option for RichView.RVFOptions: rvfoIgnoreGraphicClasses, it allows ignoring names of graphic classes specified in RVF.

"pixels per inch" value is now stored in RVF files; this value is used to scale loaded controls from RVF PPI to the actual PPI; you can disable scaling by assigning 0 to the additional integer property rveipcDPIScalable (but the actual PPI is still assigned to Font.PixelsPerInch of controls).

DocX

OnSaveDocXExtra, with Area = rv_docxs_ParaStyle, now you know the location of this paragraph in the document.

Animation

If an image contains frames of an animation, it can be played. Previously, this kind of animation was implemented only for TBitmap pictures. Now it is available for any image type.

This feature is available if RVGridAnimate unit is included in the project.

Other features

GetCurrentCharacter may return more than one characters, if they assemble a single glyph.

some improvements in table layout algorithm.