TWPRichTextLabel ComponentProperties Events |
Unit
WPCTRLabel
Declaration
TWPRichTextLabel = class(TWPCustomRtfLabel)
Hierarchy
TGraphicControl <--TWPRTFEngineBasis <--TWPRTFEnginePaint <--TWPCustomRtfLabel <--TWPRichTextLabel
Subclasses
None
Description
The TWPRichTextLabel is used to display transparent RTF text on the surface of a TForm. It inherits from the component TGraphicControl - which means it does not need any windows handle and is not able to receive focus or keyboard input.
It is a display control only.
The implementation of the TWPRichTextLabel in version 5 is very different to the one in WPTools 4 since in WPTools 5 the control inherits from the RTF engine class directly.
It only adds some custom code to initailize the painting on the graphic controls canvas and to provide some compatibility to the old RTF label. This implementation avoids a lot of overhead in creating a "wrapper".
Like the TWPRichText the TWPRichTextLabel can display the text in different layout modes, including the double page mode. It supports WordWrap and also the Stretching of the current page to the bounding rectangle.
Together with the TWPRichTextLabel component you can easily use multiple layers of controls:
TIP: The 'field' can be updated using mailmerge:
WPRichTextLabel1.DisplayedText.MergeText(Self,OnMailMergeGetText,false); |
procedure TWPLabelDemo.OnMailMergeGetText(
Sender: TObject;const inspname: string;
Contents: TWPMMInsertTextContents);
begin
Contents.StringValue := Edit1.Text;
end; |
// First set cursor and create body text
WPRichTextLabel1.Cursor.MoveTo(WPRichTextLabel1.BodyText.FirstPar, 0);
// then insert text
WPRichTextLabel1.InputString('This is a test ', true);
// Set writing attributes
WPRichTextLabel1.Cursor.WritingTextAttr.SetFontSize(16);
WPRichTextLabel1.InputString('LARGE', true); |
| Introduced Properties |
| Introduced Events |
![]() | HyperLinkEvent | |
![]() | OnMouseEnter | |
![]() | OnMouseLeave | |
![]() | OnRequestHTTPImage | |
![]() | OnRequestHTTPString | |
![]() | OnRequestStyle |
|
Copyright (C) by WP |