Page 1 of 1

[Demo] Custom text items

Posted: Thu Apr 01, 2021 3:26 pm
by Sergey Tkachenko
These demos show how to create a new item class for text items.
The demos require TRichView 19.2 or newer.
CustomTextItems.zip
(111.56 KiB) Downloaded 5696 times
A custom text item class (TRVMyTextItemInfo) is implemented in CustomTextItem.pas.
It has several new properties: BorderWidth, BorderColor, AdditionalText.
The class implements saving and loading these properties in RVF.

There are two demos: one for TRichViewEdit, one for ScaleRichView.
These demos process OnDrawStyleText event to visualize BorderWidth and BorderColor properties.
(note: these properties are stored directly in an item, not in a text style)
custom-text-items.png
custom-text-items.png (3.85 KiB) Viewed 134809 times