TRichView 18, ScaleRichView 9 - high dpi, zooming, SRVControls

News about TRichView, ScaleRichView, ReportWorkshop, RVMedia
Post Reply
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

TRichView 18, ScaleRichView 9 - high dpi, zooming, SRVControls

Post by Sergey Tkachenko »

TRichView 18, RichViewActions 8, ScaleRichView 9, ReportWorkshop 2 have been released.

Trial versions can be downloaded here: https://www.trichview.com/download/
TRichView, RichViewActions, ScaleRichView are available for Delphi, C++Builder and Lazarus (for Windows).
SRVControls, Report Workshop are available for Delphi and C++Builder.

Complete list of new features since the last major update:
- TRichView
- RichViewActions
- ScaleRichView
- Report Workshop

If you already have older versions installed, I recommend to uninstall Report Workshop before installing this update. Its demo projects were restructured, so if you do not uninstall the previous version, you will have both old and new versions of demo projects in different folders.

I've sent email about this release to all registered users who ordered TRichView since 2011. If you did not receive this email, it means that either your email server rejects our emails, or you did not confirm that you agree to receive our emails. In this case, If you want to receive our announcements, contact me by sending a forum private message or email to richviewgmailcom.

More information about changes since the last public release is below.

If you like this update, there is a Facebook "Like" button above this post :)
multires.png
multires.png (36.63 KiB) Viewed 64184 times
ActionTest demo in 96 DPI and 192 DPI. The toolbars use our icon set #2.
This announcement on Facebook: https://www.facebook.com/trichview/post ... 9700491982

Previous version
https://www.trichview.com/forums/viewtopic.php?f=6
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRichView 18, ScaleRichView 9 - high dpi, zooming, SRVControls

Post by Sergey Tkachenko »

DPI Awareness and zooming

A lot of changes were made to support high DPI display modes and make documents in TRichView DPI-independent.
(DPI - "dots per inch", a measure of screen pixels density).

User-defined document DPI and zooming

You can define DPI of document by assigning it to TRichView.DocumentPixelsPerInch property.
Essentially, this means zooming.
For examples, if we assume that DocumentPixelsPerInch = 96 is 100%, DocumentPixelsPerInch = 192 increases everything in the document twice, like applying 200% zoom.
Note: this zooming is different from zooming in our WYSIWYG editor (ScaleRichView). ScaleRichView zooms all sizes proportionally, including text width, it is necessary for WYSIWYG. As a side effect, character spacing may be not ideal in low zooming. On the contrary, zooming in TRichView produces ideal output in any DPI/zooming percent, but text width is not zoomed proportionally.

There are only two object types in documents that are not zoomed automatically: controls and images from image lists*. If you have documents that contain these objects, you need to resize controls manually, and change image lists.

* in Lazarus 2+, images from image lists are scaled as well, by requesting an image for the document DPI from TImageList.

DocumentPixelsPerInch affects only displaying documents in TRichView and TRichViewEdit. It does not affect printing, export and import (except for, obviously, controls and images from image lists).

Sizes in pixels

Since this version, if TRVStyle.Units = rvstuPixels, sizes are measured in logical pixels instead of physical screen pixels.
DPI of logical pixels is defined in TRVStyle.UnitsPixelsPerInch property. By default, it is 96, so TRichView pixels are processed like HTML/CSS pixels in browsers. Usually, it makes no sense to change this property (unless you want to emulate the old mode of physical screen pixels; in this case, assign the screen DPI to this property).

Not only sizes measured in TRVStyleUnits are affected by this property. Sizes of unscaled pictures, background images, TRichView margins are assumed to be measured in these logical pixels.

When displayed on the screen, these sizes are scaled from UnitsPixelsPerInch to the screen DPI (or DocumentPixelsPerInch, if it is defined).

Per monitor DPI awareness

In new versions of Delphi/C++Builder, our components support different monitors that may have different DPI (per monitor DPI awareness, Windows 10 feature).
A DPI of Delphi form can be changed simply by moving from one monitor to another monitor, if these monitors have different screen pixel density.
A complete and an ideal per monitor DPI awareness is implemented for Delphi and C++Builder 10.3 ("per monitor v2" mode).
Less advanced per monitor DPI awareness is implemented for Delphi and C++Builder 10.1 and 10.2.

Per monitor DPI awareness is implemented in all our editors and dialogs of RichViewActions.

Zooming in ScaleRichView

In older versions of ScaleRichView, zoom was counted relative to 96 DPI.
This means: if ZoomPercent = 100, one inch is equal to 96 screen pixels. As a result, 100% zoom was too small in High DPI display modes.
In the new version, zoom is counted relative to the screen DPI (or the current monitor DPI, for Delphi 10.1 and newer).

This change affects only zooming, it does not affect page content.

Controls in ScaleRichView

Previously, if the screen DPI <> 96, ScaleRichView did not support correct displaying of inserted controls (they were displayed too large).
ScaleRichView uses 96 DPI when calculating sizes of non-text objects.
What's why it always needs that inserted controls use 96 DPI, even if screen/monitor DPI is different.
In the new version, we solved this problem for RAD Studio 10.1 and newer.
If you use ScaleRichView with inserted controls in older versions of Delphi, unfortunately, you need to turn off DPI awareness of your application, it must always use 96 DPI.

SRVControls

SRVControls is a set of controls designed for insertion in ScaleRichView documents (buttons, check boxes, edit boxes, list boxes, etc.)
Since this version, they are DPI aware and support High DPI display modes.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRichView 18, ScaleRichView 9 - high dpi, zooming, SRVControls

Post by Sergey Tkachenko »

Lazarus 2

Lazarus 2 is supported.

We tried to keep Lazarus 1 compatibility using $IFDEF in our code, but it was not tested. If you are interested in Lazarus 1 support, let me know.

The most interested feature of Lazarus 2 that affects TRichView is multiple-resolution TImageList. In Lazarus 2, TImageList can contain several versions of the same image, and a control can request an image of necessary size. If TImageList has this image, it returns it. Otherwise, it may generate it from the closest existing image.

Our components use image list in:
- special document object types (bullets, hotspots, some types of paragraph markers)
- smart popups (buttons that can be displayed at the position of the caret)
- toolbars in ScaleRichView (that can be displayed in scrollbar areas of WYSIWYG editor or in a popup image).
We implemented support for Lazarus 2+ image lists in all these cases.

PS: multiple-resolution image lists are implemented in RAD Studio 10.3 as well, but in a different way. Delphi uses new components: TImageCollection and TVirtualImageList. Unlike Lazarus 2, new image list does not need special support from controls. However, they are less convenient for users: image size must be modified manually.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRichView 18, ScaleRichView 9 - high dpi, zooming, SRVControls

Post by Sergey Tkachenko »

Measure units

EMU

In TRichView/ScaleRichView document, integer sizes of objects are measured in units defined in TRVStyle.Units.
Older versions supported the following units:
- pixels
- twips (1 twip = 1/20 point = 1 / 1440 of an inch)

In dialogs of RichViewActions, users edit these values as integer pixels or fractional points, mm, cm, inches, picas. Unfortunately, conversions of fractional inches, mm, cm to twips and back was lossy, especially for mm.
In this update, we added one more option for units: EMU (English Metric Units).
1 EMU = 1/914400 of an inch = 1 / 36 000 of mm.
So, if you use EMU as an internal measure units, you can convert them to mm, inches and back with reasonable precision.

All our ActionTest and ReportEditor demos now use EMU instead of twips.

Pixels

If TRVStyle.Units = rvstuPixels, all values are measured in DPI-independent logical pixels (not in screen pixels as in older versions), having DPI = TRVStyle.UnitsPixelsPerInch.
See details in the message above about DPI awareness.

New types for lengths

Like before, all properties that are measured in TRVStyle.Units have TRVStyleLength type.
To make our code more clear, we added more types for integer values representing sizes:
- TRVPixelLength: this type is used for sizes measured in logical pixels with DPI = TRVStyle.UnitsPixelsPerInch (for example, TRichView.LeftMargin, RightMargin, MaxTextWidth)
- TRVPixel96Length: this type is used for sizes measured in logical pixels with DPI = 96 (many sizes of additional controls; for example, TRVFontComboBox.DropDownWidth and ItemHeight)
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRichView 18, ScaleRichView 9 - high dpi, zooming, SRVControls

Post by Sergey Tkachenko »

User interface localization

In this update, the following translations of RichViewActions were updated:
- Portuguese (Brazilian), thanks to Alexandre Garcia
- Spanish, thanks to Raúl Izquierdo
- Turkish, thanks to Ertan Küçükoglu

A new translation of Report Workshop is made:
- Turkish, thanks to Ertan Küçükoglu
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRichView 18, ScaleRichView 9 - high dpi, zooming, SRVControls

Post by Sergey Tkachenko »

SRVControls

SRVControls is a set of controls designed for insertion in ScaleRichView WYSIWYG editor.
While you can insert any controls, SRVControls are better because:
- they can be scaled without losing image quality;
- edits, memos, combo boxes of SRVControls can display caret when inserted in TSRichViewEdit.

SRVControls can be used in ScaleRichView documents, TRichView documents, or on a form.
SRVControls are free for registered users of ScaleRichView.

They include: buttons, checkboxes, radio buttons, panels, group boxes, scrollbars, edit boxes, memos, list boxes, combo boxes, tab sets, image scrollers, labels.
Most of them provide functionality of standard controls, but some of them are advanced:
- combo boxes and list boxes can show images, items may be indented to show a tree-like structure, items may have custom fonts and colors;
- list boxes can have checkboxes in items
- buttons may have images
- tab sets allow rearranging and closing tabs.

In this update, SRVControls were improved.

New appearance

SRVControls had a problem: their appearance was not consistent. Some of them were colorful and used gradients, some of them looked old-styled.
This problem can be solved by using skins (TRVSkinManager components), but it requires efforts for creating images for skins, and images look not ideal when scaled for displaying in High DPI display modes.
So we designed a new modern and consistent appearance, inspired by (but not identical to) appearance of RAD Studio 10.3.
In RAD Studio XE2 and newer, new drawing of SRVControls use GDI+ for smooth drawing with anti-aliased lines and fill borders.
zoom.png
zoom.png (10.6 KiB) Viewed 64268 times
SRVCheckBox and SRVRadioButton in ScaleRichView, zoom = 300%
A classic appearance of SRVControls is not removed. It can be returned by assigning srvcsClassic to SRVControlStyle property of SRVControls. Moreover, classic appearance was reworked and looks better now.

The important feature of new appearance is centralized control over colors. While in the classic appearance all colors were defined in the components themselves, in the new appearance most colors are defined in the global RVControlsPainter singleton object (RVControls.pas).
You can assign individual colors, or choose one of predefined color themes: pale blue, spring green, sienna, high contrast.
Simple_PaleBlue.png
Simple_PaleBlue.png (28.13 KiB) Viewed 64281 times
New appearance, pale blue theme
Simple_SpringGreen.png
Simple_SpringGreen.png (28.18 KiB) Viewed 64281 times
New appearance, spring green theme
Simple_Sienna.png
Simple_Sienna.png (28.11 KiB) Viewed 64281 times
New appearance, sienna theme
Simple_HighContrast.png
Simple_HighContrast.png (27.88 KiB) Viewed 64277 times
New appearance, high contrast theme
Classic.png
Classic.png (26.86 KiB) Viewed 64255 times
Classic appearance
Unicode

SRVControls are Unicode in all versions of Delphi.

High DPI

Since this update, all SRVControls support High DPI display modes. They support per monitor DPI awareness in new versions of Delphi.

Bi-directional text

Since this update, all SRVControls work correctly with bi-directional text.
BiDiMode property is published and completely supported.

Edit and memos

In this update, TSRVEdit and TSRVMemo are rewritten completely.
Previously, they were based on the standard edit control; they only changed drawing.
Now, they are written in pascal from scratch.
It gives them the following advantages:
- Unicode in all version of Delphi;
- complete color customization, including selection color;
- scrollbars in memo are supported;
- SRVMemo works faster than the standard memo.

Tab sets

TSRVTabSet has a new property: OppositeTabPosition. By default, tabs are shown on top (for horizontal tab sets) or on the left side (for vertical tab set). This property allows displaying them below / to the right side.

Other

There are many other tweaks and fixes in SRVControls (too many to list them here).
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRichView 18, ScaleRichView 9 - high dpi, zooming, SRVControls

Post by Sergey Tkachenko »

New demo projects with multiple-resolution image lists

About new image lists

Lazarus 2 and RAD Studio 10.3 introduced image lists that can contain images of different sizes.
They are implemented differently.
In Lazarus, TImageList was improved. It may contain images of different size, and components may request the proper images depending on their DPI.
LazarusIL.png
LazarusIL.png (64.74 KiB) Viewed 64243 times
TRichView toolbar icon set in Lazarus 2
In Delphi and C++Builder, two new components are added: TImageCollection (a collection of various images, grouped by names) and TVirtualImageList (image list that displays images from TImageCollection). Unlike in Lazarus, TVirtualImageList provides images of the specified size, but you can change image size when DPI is changed.
DelphiRioIL.png
DelphiRioIL.png (123.06 KiB) Viewed 64243 times
TRichView toolbar icon set in Delphi 10.3
The both new image lists can generate pictures basing on existing pictures. For example, if it has only 16x16 and 32x32 images, it can generate 24x24 by scaling down 32x32.
The both of them can generate disabled images automatically. However, only Delphi's TVirtualImageList can apply transparency to disabled images. So in Lazarus we still provide our version of disabled images; in Delphi, we generate them.

New demo projects for RAD Studio 10.3

The main demo projects showing features of our components are several versions of ActionTest demos for TRichViewEdit and ScaleRichView, and ReportEditor demos for ReportWorkshop.
In this update, in addition to existing versions of these demos, we added new demos for Delphi and C++Builder 10.3 that use virtual image lists. They have "_Multires" suffixes in folder names.

New TRichViewEdit-based ActionTest demos:
- RichViewActions\Demos\DelphiUnicode\ActionTest_MultiRes\ - for Delphi
- RichViewActions\Demos\CBuilderUnicode\ActionTest_MultiRes - for C++Builder.

The Delphi version uses two alternative TImageCollection components from dmActionsImageCollection1.pas (icon set #1) and dmActionsImageCollection2.pas (icon set #1) and TVirtualImageList components from dmActionsVirtualImageLists.pas (the units are in RichViewActions\Source folder). The image collections contain all images necessary for RichViewActions, ScaleRichView, and Report Workshop. The virtual image lists has the same indexes as a normal image list from the demo for Delphi 2009+, so you can easily convert your existing projects.
Image collections contain 16x16 and 32x32 images for all commands, and 64x64 images for selected commands.

The C++ version is the same, but uses dmActionsImageCollectionCPP1.cpp, dmActionsImageCollectionCPP2.cpp, dmActionsVirtualImageListsCPP.cpp from RichViewActions\SourceCPP\ folder.

These demos have the following differences from previous ActionTest demos
- they are DPI-aware ("per monitor v2")
- they do not use TCoolBar, toolbars are placed directly on a form, combo boxes are placed on a panel;
- toolbars for table operations and cell borders are removed (use the main menu)
- "Insert | Equation" command is added
- a combo box for changing zoom is added. It allows choosing between "Auto" (DPI of the current monitor), 50% (48 DPI), 100% (96 DPI) and so on (there is no problem in adding this combobox in the demos for older versions of Delphi/C++Builder; probably, we will do it in future).
ZoomComboBox.png
ZoomComboBox.png (51.88 KiB) Viewed 64231 times
New ScaleRichView-based ActionTest demos:
- ScaleRichView\Demos\Delphi\ActionTestTabs_MultiRes\ - for Delphi
- ScaleRichView\Demos\CBuilderUnicode\ActionTestTabs_MultiRes - for C++Builder.

The Delphi demo uses the same units for image collection as Delphi demo above, and virtual image lists from SRVActionsVirtualImageListsDM.pas.
The C++ demo uses the same units for image collection as C++ demo above, and virtual image lists from SRVActionsVirtualImageListsDM.cpp.

New ReportEditor demos will be discussed in the next message.

Demo projects for Lazarus

Instead of creating new demos for Lazarus, we modified existing demos by replacing units with image lists.
The demo in RichViewActions\Demos\Lazarus\ActionTest\ uses dmactionsimagesmultireslaz1.pas and dmactionsimagesmultireslaz2.pas from RichViewActions\SourceEx\ folder.
The demo in ScaleRichView\Demos\Lazarus\ActionTestTabs\ uses srvimagesmultireslaz1.pas and srvimagesmultireslaz2.pas from ScaleRichView\SourceEx\ folder.
Old datamodules containing 16x16 images were not removed, but are not used.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRichView 18, ScaleRichView 9 - high dpi, zooming, SRVControls

Post by Sergey Tkachenko »

Report Workshop

Report Workshop does not receive new features in this update. All its changes were made to support DPI-awareness and document zooming (in dialogs and value visualizers).

Demo projects for Report Workshop were restructured:
- they are moved from ReportWorkshop\Demos\ to ReportWorkshop\Demos\Delphi\
- ReportEditor demos now use common main form units (instead of almost identical units in the previous version)
- when applicable, all ReportEditor demos (for BDE, IBX, FireDAC, MicroOLAP DAC for MySQL and PostgresDAC, NexusDB, ElevateDB, ZEOSLib) have multiple versions (for Delphi 5-2007; for Delphi 2009+; ScaleRichView version for Delphi 2009+; DPI-aware version for Delphi 10.3+; ScaleRichView DPI-aware version for Delphi 10.3+).

The NexusDB database is repacked with the new version of NexusDB. In "Crosstab Employees x Employees.rw", the data query that generates an empty image was changed from "CAST(NULL as BLOB)" to "CAST(NULL as IMAGE)", because the new version of NexusDB does not accept the old syntax.
NexusDB-50PrcZoom.png
NexusDB-50PrcZoom.png (98.6 KiB) Viewed 64229 times
DPI-aware version of ReportEditor for NexusDB, report result, 50% zoom
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRichView 18, ScaleRichView 9 - high dpi, zooming, SRVControls

Post by Sergey Tkachenko »

Grid animation

In addition to Gif animation, our components support one more animation type: grid animation.
An image can be treated as a grid containing animation frames.
In the previous version, this feature worked only for TBitmap.
In this update, it works for any image, just specify the number of frames horizontally and vertically, and animation interval.
Important: since this update, grid animation works only if you include RVGridAnimate unit in your project.

A new simple demo is added in
- TRichView\Demos\DelphiUnicode\Assorted\Graphic\GridAnimation
- TRichView\Demos\CBuilderUnicode\Assorted\Graphic\GridAnimation
It loads a PNG image and animates it.
clock.gif
clock.gif (41.66 KiB) Viewed 64229 times
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRichView 18, ScaleRichView 9 - high dpi, zooming, SRVControls

Post by Sergey Tkachenko »

PDF export

New features are implemented in a way so that they do not require changes in most existing projects.
However, there is an exception: PDF generation, since DPI is used to convert various measure units to pixels. Our PDF export demos (using LLPDFLib, SynPDF, eDocEngine) were changed accordingly.
These demos are in ThirdParty\Export\ folder.

If you use eDocEngine, some changes are required in its code.
1) In gtExpIntf.inc, add:

Code: Select all

{$DEFINE RichView_18}

{$IFDEF RichView_18}
  {$DEFINE RichView12Up}
  {$DEFINE RichView16Up}
  {$DEFINE RichView17Up}
  {$DEFINE RichView173Up}
  {$DEFINE RichView18Up}
{$ENDIF}
2) Replace gtRichViewIntf.pas with the attached file.
gtRichViewIntf.pas
(15.42 KiB) Downloaded 2654 times
If you have several copies of the above mentioned files, replace all of them.

I sent this information to Gnostice for inclusion in the next update.

Update: Gnostice informed me that they released eDocEngine update supporting TRichView 18.

HTML import using THTMLViewer

Since this update, TRichView setup assumes that THTMLViewer packages have no suffixes for RADStudio 10.1, 10.2, 10.3, and named simply FrameViewer.dproj.
(In previous version, it assumed that they are named FrameViewerXE10.dproj, FrameViewerXE11.dproj, FrameViewerXE12.dproj)
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

TRichView 18.0.1, ScaleRichView 9.0.1

Post by Sergey Tkachenko »

We've uploaded TRichView 18.0.1, RichViewActions 8.0.1, ScaleRichView 9.0.1

This is a maintenance update: no new features, some bug fixes, mostly related to SRVControls.

One more translation of RichViewActions UI was updated:
- Portuguese (European), thanks to Bruno Martins
Post Reply