TRichView demo projects for Android

TRichView 20.5.1: demos for Android, text search, line highlight

We’ve uploaded new versions of our components: TRichView 20.5.1.

Trial versions are available here:

New in this version:

  • All applicable demo projects are ported to Android (FireMonkey)
  • Using platform spelling checking service (FireMonkey)
  • Adding live spelling suggestions in a popup menu (FireMonkey)
  • Improved “SmartPopup” buttons (FireMonkey)
  • Text search without selecting results is improved
  • Custom drawing of the current line

In this version, the VCL trial version uses the same trial protection as the FireMonkey version: documents are “watermarked” when displayed and printed. Previously, it displayed a red floating label that could be too annoying.

The setups wizards were updated (both the main setup and IDE installer) to use modern UI.

FireMonkey demo projects

In the previous update of TRichView, we ported to Android only Tutorial“Editors\Editor 1” and “Editors\Editor 2\” demos.
In this update, the rest of demo projects has been ported.

Main changes:

  • responsive UI design to fit both desktop and mobile screens
  • using non-modal dialogs in Android
  • using special functions to choose files instead of TOpenDialog and TSaveDialog in Android
  • replacing menus (usually with TPopup containing TListBox).

However, many demo projects were redesigned completely. For example, “Assorted\Search and Replace” demo allows searching using toolbars, “Assorted\Fields\MailMerge*\” demos have a template editor and a result generator combined in a single application.

There is a topic with additional information about ported demo projects (including videos and screenshots): viewtopic.php?t=11205

Background spelling checking in FireMonkey

Like VCL/LCL version, FireMonkey version of TRichView editor can check spelling in a background thread and mark misspelled words with special red underlines. Words are checked using third-party components in OnSpellingCheck event.

In this update, TRichViewEdit offers one more option: using a spelling checking service provided by the current platform. Currently, FireMonkey implements this service for macOS. To activate this feature, assign TRichViewEdit.CheckSpelling = True. With a platform service, you do not need to assign any events, everything works automatically.

Ok, misspelled words are found and marked, how to correct them?

Suggestions for correction of the current misspelled word can be added to a popup menu. If your editor uses the standard popup menu (when PopupMenu property is not assigned), suggestions are added automatically. If you use a custom popup menu, you can use AddSpellingMenuItems to add suggestions to your menu.

If you use a third-party spelling checker, you can assign OnGetSpellingSuggestions to provide information for adding spelling menu items.

Improved “smart popup” buttons

“SmartPopup“ buttons can be shown in the editor under the specified conditions. In VCL/LCL version, you can either assign PopupMenu to this button, or process a click on this button.

Improvements in this update of FireMonkey version:

  • FireMonkey for Android does not support TPopupMenu. So, for Android, TRichViewEdit automatically creates and uses a TPopup component that offers the same options as PopupMenu. Text, images, checks are supported.
  • you can assign Popup to a “SmartPopup“ button
  • a glow effect is used to display a shadow

This screenshot shoes a popup created from TPopupMenu:

Auto-created popup

Text search without selecting

By default, when you call SearchText method, it selects the found text.
It may be undesirable, because selection requires a formatted document (and you do not want to display a document and want to skip a formatting step for efficiency), and TRVReportHelper component does not support selection.
You can use OnTextFound event to prevent selection.

It was implemented in older versions of TRichView. But how to continue search from the last found results without selecting them?
The new version offers this option using StoreSearchResult method.

This feature is used in the updated wrapper for ReportBuilder (reporting components by Digital Metaphors) to highlight search results in a report preview: viewtopic.php?t=11225
Internally TppRichView object uses TRVReportHelper component, and text is searched in this component.

Text search in ReportBuilder preview

Event to highlight the current line

One more custom drawing event is added: OnDrawCurrentLine.

Highlighting the current line using the new event
Share this article