TRichView 22.4 - cross-platform spell-checking, dark mode

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

TRichView 22.4 - cross-platform spell-checking, dark mode

Post by Sergey Tkachenko »

We have released TRichView 22.4, ScaleRichView 12.3, and updates of related components

Main changes in this version:
  • new cross-platform spell-checking component and platform service
  • dark mode option
  • using text color from FireMonkey style
  • high-quality drawing of metafiles (in VCL version)
A trial version can be download here: https://www.trichview.com/download/

Previous version
viewtopic.php?t=12722 (ReportWorkshop)
viewtopic.php?t=12258
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

TRVSpellChecker

Post by Sergey Tkachenko »

TRVSpellChecker

Image TRVSpellChecker is a new component that uses spelling checking functions provided by OS.

The FireMonkey version supports Windows, macOS, iOS, Linux (all OS except for Android).

Linux does not have a system spelling checking library, so the Linux version of TRVSpellChecker uses HunSpell.
Windows provides spelling checking functions since Windows 8.

The list of supported features is different for different OS, see https://www.trichview.com/help/idh_trvs ... tures.html
For example, auto-correction is supported only on Windows, guessing word completions is only on macOS and iOS.

Image
Spelling checking on macOS platform (FireMonkey)

Image
Spelling checking on Windows platform (VCL ActionTest demo)


The component provides spell-checking both using dialogs (in Windows, macOS, Linux) and in a background thread.
You can choose from 2 types of dialogs: a classic dialog type (where the user can correct a misspelled word) and a dialog type that once was used by Microsoft Office (where the user can correct not only a misspelled word by also a surrounding text).
Image
Classic spell-checking dialog


UI of the dialogs is in English. If you use RichViewActions (in VCL and Lazarus version), UI of these dialogs is automatically translated. Otherwise, you can use an event that occurs when a dialog is created, and localize it yourself (or use some tool that localizes application's forms).

Using as a platform service

In FireMonkey, you can call RVSpellChecker.RegisterAsService to use this component as a FireMonkey platform spelling checking service.
In this way, you can use it to check spelling in other controls supporting IFMXSpellCheckerService, such as TEdit or TMemo.
It is especially useful in OS where spelling checking is not implemented by Embarcadero (Windows and Linux).
But it is also useful in iOS and macOS, because TRVSpellChecker provides more features (for example, switching a dictionary).

TRichViewEdit can use FireMonkey platform service as well, if you assign its CheckSpelling property = True. However, it's recommended to use TRVSpellChecker directly, when possible.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Dark Mode

Post by Sergey Tkachenko »

Colors: dark mode

A new property TRichView.DarkMode inverts luminance (lightness) of all colors in the document (except for pictures)
Light colors become dark, dark colors become light.
This property is called "dark mode" because normally we use black-text-on-white-background documents, they become white-text-on-black-background documents.
This mode is similar to MS Word's black theme.

This mode is implemented not only in TRichView and TRichViewEdit.
It is also implemented in:
  • TRVPrintPreview (DarkModeUI property - affects area around the page)
  • TRVPrint and TRVReportHelper (DarkMode property)
  • TRVRuler from RichViewActions and TSclRVRuler from ScaleRichView (DarkMode property)
  • Pages (TSRichViewEdit.ViewProperty.DarkMode) and area around pages (TSRichViewEdit.ViewProperty.DarkModeUI) in ScaleRichView.
  • SRVControls.
srvcontrols-darkmode.png
srvcontrols-darkmode.png (50.87 KiB) Viewed 34053 times
By default, SRVControls follow the dark mode setting of the parent editor


darkmode.png
darkmode.png (134.94 KiB) Viewed 34053 times
The screenshot above shows a dark mode in RichViewActions with the following settings:
  • The application uses VCL theme "Onyx Blue"
  • TRVRuler is not in a dark mode (DarkMode = False), but it uses VCL theme colors
  • TRichViewEdit is in a dark mode (DarkMode = True), and it does not use VCL theme colors (UseVCLThemes = False) (because dark mode + dark VCL theme would produce an undesired effect)
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Colors

Post by Sergey Tkachenko »

Colors: FMX themes

In FireMonkey, TRichView uses the same FireMonkey style as TMemo (by default).
If a background color is not specified explicitly, TRichView uses a background defined in the style.
It leads to a problem with dark FMX styles: if a background is black, and a text is black too, it becomes invisible.
To solve this problem, you can assign UseFMXThemes property = True.
With this setting, everything that has the black color (text, lines, backgrounds) is painted using a foreground color defined in the FireMonkey style.
Other colors are not affected.

Colors: custom color schemes

In VCL, TRichView can draw system colors (like clWindow or clWindowText) using colors specified in a VCL theme.
To activate this feature, assign UseVCLThemes property = True.

This update introduces one more possibility: in VCL and Lazarus, you can define your own function that replaces system colors. Assign it to the global functional variable RVGetSystemColor
This function is used only if UseVCLThemes property = True.
While this feature was designed to apply custom schemes of system colors, you can perform any other color transformation using this function (for example, increase contrast or change colors to grayscale)
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Images

Post by Sergey Tkachenko »

Images: metafiles

Since this version, TRichView implements a better drawing of TMetafile images with use of GDI+.
Include RVGDIPlusGrIn unit in your VCL projects (or add RVGDIPlusGrIn in "uses" of the main form).
In this mode, GDI+ effects are applied to metafiles, such as anti-aliased lines.
gdiplus-metafile.png
gdiplus-metafile.png (72.46 KiB) Viewed 34047 times

Images: SVG

Drawing SVG images with Skia4Delphi (TSkSvgGraphic) is improved in ScaleRichView
TSkSvgGraphic draws an image using a temporal buffer. This update makes sure that this buffer is sized according to the zooming in a WYSIWYG editor.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Demo projects

Post by Sergey Tkachenko »

Changes in the demo projects

The following demo projects are changed:

1. All projects in "*\Assorted\CustomDraw\" - DarkMode parameter is added to event handlers and method calls

2. In FireMonkey, Editors\Editor 2\ demo now includes spelling checking commands.
You can see a screenshot of this demo on the macOS platform above.

The VCL and Lazars analogs of this demo were not changed. However, ActionTest demos (from RichViewActions) are updated to use spelling checking.
You can see a screenshot the ActionTest demo above.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Installer update

Post by Sergey Tkachenko »

The setup of TRichView for Delphi FireMonkey has been updated.
The application that installs the component in Delphi IDE has been fixed. Previously, if an IDE had Linux platform but paths for it were not configured, the IDE installer could delete Win32 package soon after creating it (this problem might happen for some other platforms as well).

This problem does not affect VCL and C++Builder versions of the installer (because they do not support problematic platforms), so these setups were not updated.

PS: the trial installers still contain additional precompiled files for Delphi 11 Community Edition. They will be changed to Delphi 12 in the next TRichView update. Currently, if you want to install the trial in Delphi 12 Community Edition, you need to open packages in Delphi IDE and compile them manually.
LeoFreskos
Posts: 1
Joined: Sun Nov 17, 2024 7:55 pm

-

Post by LeoFreskos »

Awesome. Always excited to see an update to my favorite tool.

I am trying dark mode. Since I usually have the grid lines on, the bright white on grey seems more distracting than useful in Dark mode. Is there a way to make them more subtle?
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRichView 22.4 - cross-platform spell-checking, dark mode

Post by Sergey Tkachenko »

It seems that I forgot to apply dark mode to grid lines. It will be fixed in the next update.
Meanwhile, you can modify grid line color properties in TRVStyle: https://www.trichview.com/help/idh_trvs ... rties.html
Post Reply