TWPRichTextLabel Component
Properties Events
The TWPRichTextLabel is a TGraphic-Control to be used to display transparent RTF or HTML text.

Unit
WPCTRLabel

Declaration
TWPRichTextLabel = class(TWPCustomRtfLabel)

Hierarchy
TWPRTFEngineBasis <--TWPRTFEngineEdit <--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 6 is very different to the one in WPTools 4 since in WPTools 6 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);

The procedure OnMailMergeGetText procedure has been defined as:
procedure TWPLabelDemo.OnMailMergeGetText(
    Sender: TObject;const inspname: string;
    Contents: TWPMMInsertTextContents);
begin
   Contents.StringValue := Edit1.Text;
end;

Example how to add text to a WPRichTextLabel:
// 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
Align 
Anchors 
AutoZoom 
Color 
DeskColor 
Editable 
Font 
FormatOptions 
FormatOptionsEx 
Height 
Hint 
HyperLinkCursor 
HyperLinkEvent 
LayoutMode 
Left 
OnClick 
OnDblClick 
OnDragDrop 
OnDragOver 
OneClickHyperlink 
OnEndDrag 
OnMouseDown 
OnMouseMove 
OnMouseUp 
OnRequestHTTPImage 
OnRequestHTTPString 
OnRequestStyle 
PageColumns 
PageRows 
PaperColor 
Resizing 
RTFText 
ShowHint 
Stretched 
TextLoadFormat 
TextSaveFormat 
Top 
Transparent 
ViewOptions 
Visible 
Width 
WordWrap 
Zooming 

Introduced Events
OnMouseEnter 
OnMouseLeave 


WPCubed