Class TWPRTFEngineBasis

Hierarchy

System.TObject | System.Classes.TPersistent | System.Classes.TComponent | Vcl.Controls.TControl | Vcl.Controls.TGraphicControl | TWPRTFEngineBasis

Subclasses

WPRTEEdit.TWPRTFEngineEdit

Properties

Methods

Function LoadFromStream(Source:TStream; InsertText:Boolean; FormatName:string; SplitPar:Boolean; Reader:TWPCustomTextReader; AfterLoadEvent:TWPIOAfterLoadWithReader) : Boolean

Function MeasureObject(MeasureObjectMode:TWPMeasureObjectMode; Par:TParagraph; posinpar:Integer; PageNumber:Integer; xoff:Integer; maxx:Integer; YOff:Integer; maxy:Integer; curr_page:TWPVirtPage; w:Integer; h:Integer; PaintObject:TWPTextObj; PaintCanvas:TCanvas; SectionID:Integer; LockWidth:Boolean) : WideString

Function OpenCodeAt(Par:TParagraph; posinpar:Integer; CheckedCodes:TWPTextObjTypes) : TWPTextObj

Procedure ParagraphsOnPage(RTFPageNo:Integer; list:TWPParagraphPosList)

Function ParListedBefore(par1:TParagraph; par2:TParagraph; pos1:Integer; pos2:Integer) : TThreeState

Procedure ReformatAll(InitializeAll:Boolean; SpellcheckAll:Boolean; ReformatProcedure:TWPAbstractRTFDataBlockFormatter)

Function RefreshAniImages(toCanvas:TCanvas; x:Integer; Y:Integer) : Boolean

Procedure RemoveDrawRect(obj:TWPObject)

Procedure RemoveRTFData

Procedure Repaint

Function SaveSelectionToStream(Destination:TStream; FormatName:string) : Boolean

Function SaveToStream(Destination:TStream; FormatName:string) : Boolean

Function ScreenToTwip(PixelValue:Integer) : Integer

Procedure SetEnvironment(Environment:TWPToolsBasicEnviroment)

Procedure SetMonitorDPI(xres:Integer; yres:Integer)

Procedure SetRTFDataOrProps(NewRTFData:TWPRTFDataCollectionBase; NewRTFProps:TWPRTFProps)

Function SpellcheckPar(Par:TParagraph; CheckAll:Boolean; DontModify:Boolean) : Boolean

Function TwipToScreen(TwipValue:Integer) : Integer

Events

BeforeInitializePar : TWPInitializeParEvent= TWPInitializeParEvent

This event is triggered before a paragraph is initialized. This happens after each change in the paragraph. This event makes it possible to prepocess the paragraph, for example to hide it with "par.Hidden:=true;" or to change the attributes depending on the contents of the paragraph.

OnCheckProtection : TWPCheckProtectedEvent= TWPCheckProtectedEvent

This event is triggered when the engine 'thinks' certain text is protected

OnEditFieldFocus : TWPEditFieldFocusEvent= TWPEditFieldFocusEvent

This event is triggered before an edit field looses the focus and before a different edit fields receives the focus

OnEditFieldGetSize : TWPEditFieldGetSize= TWPEditFieldGetSize

This event is used to change the width of a edit field. It can be used to modify the closing marker to reflect a certain maximum size of insertable characters

OnInplaceeditCustomPaint : Boolean= Boolean

This event allows to implement custom painting for inplace editors. function TWPTableProducerTest.DoOnInplaceeditCustomPaint( Sender : TControl; Editor : TWPToolsInplaceEditorAbstractBase; Canvas: TCanvas; var Bounds : TRect; BaseLine : Integer; Stage : TWPToolsInplaceEditorPaintStage; var PaintData : TObject; Xmul : Single = 1; Ymul : Single = 1 ) : Boolean; begin Result := true; // default! if (Stage=wpPaintData) and (Editor is TWPToolsBaseWinControlInplaceEditor) and (TWPToolsBaseWinControlInplaceEditor(Editor).group<3) then begin SetTextAlign(Canvas.Handle, TA_BASELINE); Canvas.TextOut(Bounds.Left, Bounds.Top + BaseLine, TWPToolsBaseWinControlInplaceEditor(Editor).Caption); WPImageList1.DrawImage(Canvas, Bounds.Right-Bounds.Height, Bounds.Top, Bounds.Height, Bounds.Height, true, true, 10 + Ord(TWPToolsBaseWinControlInplaceEditor(Editor).Checked)); Result := false; end; end;

OnPrepareBandCaption : TWPPrepareBandCaption= TWPPrepareBandCaption

Thi internal event can be used to prepare the caption of a band or group as displayed in the editor. Than band is an object of the class TWPBand.

OnPrepareParForPaint : TWPInitializeParEvent= TWPInitializeParEvent

This event is triggered by the paint routine for a paragraph which uses the flag paprNeedPreparePaintEvent in 'props'. This event may update some character properties but no properties which change the width of a character. Normally this event is used best to implement SpellAsYouGo.

Used or referenced by

-Procedure TWPSuperMerge.PaintBand(Memo:TWPRTFEngineBasis; toCanvas:TCanvas; par:TParagraph; r:TRect; PaintBandMode:TWPPaintBandMode; PaintModes:TWPPaintModes)