TWPCustomRtfEdit Object
Properties Methods Events

Unit
WPCTRMemo

Declaration
TWPCustomRtfEdit = class(TWPCustomRTFControl)

Hierarchy
TWPCustomRTFControl <--TWPCustomRtfEdit

Direct subclasses
TWPCustomRichText TWPPreview TWPStyleScroller

Description
This is the central component in WPTools, the editor. It hosts the 'RTF-Engine' which is defined in class TWPRTFEnginePaint and available through the property Memo.

The property RTFText is used to store text in any supported format. It is not a reference to the engine, just more or less a container.

Most functionality of the RTFEngine is published by the editor through properties and methods, but especially for the dynamic creation of text it might be useful to use the reference to the active text or the cursor class TextCursor.

The TWPRTFDataCollection which is used by the editor can be referenced by Memo.RTFData. The page size is stored in Header. Different layout modes can be selected in property LayoutMode.
This is a screen shot of a TWPRichText component using the layout mode 'thumbnails' with additional display of page numbers in the 'page gap'. (ViewOptions)


To change the load and save format the properties TextSaveFormat and TextLoadFormat can be modified. But the methods to load and save also can receive an optional parameter specifying the format. Possible format strings are 'RTF', 'ANSI', 'HTML' and 'WPTOOLS'.

The class TWPRichText also has the property CurrAttr to modify the current text attributes. Automatically the current writing attributes or the attributes of the selected text are change. This is useful if you do not want to use the provided GUI controls (TWPToolBar or the standard actions) and want to synchronize your tool buttons. At a lower level, also in TWPCustomRTFedit, the interfaces WritingAttr and SelectedTextAttr are provided. In contrast to CurrAttr this interfaces use Set and Get methods to work with attributes to make it possible to check weather a property is defined. CurrAttr uses standard properties, they are easier to use but less powerful.
Note
A) The editor will always creates line breaks to fit the lines on the current page width (Header). The property WordWrap is only used to force using the editor width instead of the page width.
B) Text can be protected. Which kind of text is protected is selected by property ProtectedProp.
C) To attach the editor to a database field we recommend to use the property AsString. D) The component TWPRTFStorage is used to create linked ediotors which are working with the same text (multi view or text path editing)


Introduced Properties
AcceptFiles 
AcceptFilesOptions 
 ActiveFirstPar 
 ActiveLineLen 
 ActiveLineStart 
ActiveParagraph 
ActivePosInPar 
 ActiveSection 
ActiveStyleName 
ActiveText 
AfterImageSaving 
AsString 
AsWebpage 
Attr 
AutomaticTextAttr 
AutoZoom 
AvailableDialogs 
BeforeInitializePar 
 BodyText 
BookmarkTextAttr 
BorderStyle 
Canvas 
 Caret 
CaretDisabled 
 Cell 
ClickableCodes 
ClipboardOptions 
ColorDesktop 
ColorDesktopTo 
Columns 
CPChar 
CPCharAttr 
CPChars 
CPColNr 
CPLine 
CPLineNr 
 CPLineNrLog 
 CPObj 
CPPage 
 CPPageLineNr 
CPPar 
CPParNr 
CPPosInPar 
CPPosition 
CPPrevChar 
CPPrevWideChar 
CPWideChar 
CPWord 
 CPXPos 
 CPYPos 
 CurrentMouseButton 
 CurrentZooming 
CursorOnText 
CustomSyntax 
DebugMode 
DefaultNumberIndent 
DeskGradientHorizontal 
DisabledDialogsInPreview 
DisplayedText 
DropHandled 
EditBoxModes 
EditOptions 
EditOptionsEx 
EditOptionsEx2 
FieldObjectTextAttr 
 Finder 
FirstPar 
Font 
FormatOptions 
FormatOptionsEx 
FormatOptionsEx2 
GraphicPopupMenu 
Header 
 HeaderFooter 
HiddenTextAttr 
HideTableBorders 
HighLightColor 
HighLightTextColor 
HyperLinkCursor 
HyperLinkEvent 
 HyperlinkObj 
HyperlinkTextAttr 
ImeMode 
ImeName 
Inserting 
InsertPointAttr 
InWaitForPaintEditor 
KeyInLock 
 LabelDef 
LastFileName 
LastLoadPath 
 LastPar 
LastSavePath 
LayoutMode The central property to change the way the engine displays the pages.
LeftOffset 
Lines 
 Memo 
Modified 
 MouseMarginArea 
 MousePage 
 MouseX 
 MouseY 
OnCheckProtection 
OnCustomLinePaintAfter 
OnCustomLinePaintBefore 
OneClickHyperlink 
OnEditFieldFocus 
OnEditFieldGetSize 
OnGetSpecialText 
OnMeasureTextPage 
OnMouseDown 
OnMouseUp 
OnPrepareImageforSaving 
OnPrepareParForPaint 
OnRequestHTTPImage 
OnRequestHTTPString 
OnRequestStyle 
PageColumns 
 PageCount 
PageMaxCount 
PageMinCount 
Pagenumber 
PaperColor 
 PaperDefs 
PopupMenu 
PrintParameter 
ProtectedProp 
ProtectedTextAttr 
Readonly 
Resizing 
Rows 
 RTFData 
RTFText 
RTFVariables 
ScrollBars 
 ScrollHorzMultiplicator 
 ScrollVertMultiplicator 
SecurityOptions 
SelectedObject 
SelectionAsString 
SelLength 
 SelRect 
SelStart 
SelText 
ShowMergeFieldNames 
ShowPagenumber 
SinglePageMode 
SPANObjectTextAttr 
SpellCheckStrategie 
SpellIgnoredForObj 
Table 
TableCell 
TableCellWidth 
 TableColCount 
TableColNumber 
TableRow 
 TableRowCount 
TableRowNumber 
text 
 TextColorCount 
TextColors 
TextLoadFormat 
TextLoadFormatClipboard 
TextLoadSaveOptions 
TextObjectCursor 
 TextObjects 
TextSaveFormat 
TextSaveFormatClipboard 
TopOffset 
TopVisiblePar 
Transparent 
ViewOptions 
ViewOptionsEx 
ViewPage 
ViewRTFData 
WantReturns 
WantTabs 
WordWrap 
WPRTFPropsComponent 
WriteObjectMode 
XBetween 
XOffset 
YBetween 
YOffset 
YOffsetNormal 
Zooming 

Introduced Methods
_MakeDynamic 
_RefreshMsglist 
ActivePar 
AddTable 
ADel  Modify the current paragraph attribute by changing a certain property to 'undefined'.
AGet  Read the current paragraph attribute.
AHasStyleDef 
AppendAsSection 
AsANSIString 
ASet  Modify the current paragraph attribute by changing a certain property.
ASetAdd  Modify the current paragraph attribute by setting bits in a bitfield property.
ASetDel  Modify the current paragraph attribute by deleting bits in a bitfield property.
Assign 
AssignPrintProperties 
AssignToFooter 
AssignToHeader 
AttrHelper  Interface class to calculate character attr index values.
BeforeDestruction 
BeginPrint 
BeginTable 
BeginUpdate 
Bof 
BookmarkAtCP 
BookmarkAtParLin 
BookmarkAtXY 
BookmarkDelete 
BookmarkDeleteAllMarkers 
BookmarkDeleteInPar 
BookmarkDeleteMarkers 
BookmarkFind 
BookmarkFirstInPar 
BookmarkFirstObjInPar 
BookmarkForceInPar 
BookmarkGetList 
BookmarkInput 
BookmarkMoveTo 
BookmarkMoveToNext 
BookmarkSelect 
BrushApply 
BrushEnd 
BrushStart 
CalcMousePageAtXY 
CanRedo 
CanUndo 
ChangeApplied 
Changing 
CheckHasBody 
CleanTemporaryCharAttr 
Clear 
ClearBody 
ClearEx 
ClearHeaderFooter 
ClearSections 
ClearSelection 
ClipbrdFormatName 
CodeExistInText 
CodeInsideOf 
CodeListTags 
CodeLoadSaveEmbeddedText 
CodeLocate 
CodeMoveTo 
CodeObjectAtXY 
CodeRename 
CodeSelect 
CodeSelectText 
CombineCells 
CombineCellsVertHorz 
CombineCellsVertically 
CombineTables 
ContextPopup 
ConvertTablesToText  Error in DocComment
ConvertTableToText 
ConvertToCPPosition 
CopyAttr 
CopyToClipboard 
CopyToClipboardAttr 
CountLines 
CountPages 
CountParagraphs 
CountWords 
CPAttr  CPAttr offers direct manipulation and examination of the character attributes at the cursor position.
CPLogicalParagraphEnd 
CPMoveBack 
CPMoveDownLine 
CPMoveDownPar 
CPMoveNext 
CPMoveTo 
CPMoveToItem 
CPMoveUpLine 
CPMoveUpPar 
CPPagenrAsDisplayed 
Create 
CreateDynamic 
CreateTableOfContents  Creates a table of contents
CurrentCharAttr  This property provides an interface to the character attributes at the cursor position.
CurrentEditField 
CutToClipboard 
DBChanging 
DefaultAttr  Default for text which does not use attributes.
DelayedInvalidate 
DelayedReformat 
DeleteChar 
DeleteColumn 
DeleteField 
DeleteFieldAtCP 
DeleteFields 
DeleteFocusValues 
DeleteHyperlink 
DeleteLeadingSpace 
DeletePage 
DeleteParagraphBreaks 
DeleteParWithCondition  Error in DocComment
DeleteParWithEmptyFields 
DeleteParWithText 
DeleteRow 
DeleteTable 
DeleteTrailingSpace 
Destroy 
DoAfterImageSaving 
DoPrepareImageforSaving 
DoRequestHTTPImage 
DoRequestHTTPString 
DoUpdateCharAttr 
DoUpdateEditState 
DoUpdateEditStateEx 
DoUpdateParAttr 
DoUpdateState 
DoUpdateUndoState 
DragDrop 
Draw 
EndPrint 
EndTable 
EndUndolevel 
EndUpdate 
Enviroment 
Eof 
FastAppendActiveLine 
FastAppendText 
FastAppendTextParID 
FastAppendTextWithParID 
FieldAtCP 
FieldExists 
FieldGetInPar 
FieldGetList 
FieldGetNameInPar 
FieldGetNames 
FieldLocate 
FieldReadText 
FieldRename 
FindNext 
FindParWithText 
FindTable 
FindTextBoxPar 
FindTextMethod 
FixFontsOfText 
FontListAssign 
FootNoteAtCP 
FootnoteFindNext 
FootnoteFindPrior 
FootnoteGetList 
FootNoteInsert 
FrameLine 
GetCellCommands 
GetCellNames 
GetCharAttr 
GetCodeTags 
GetColorNr 
GetCPXYPoint 
GetFontName 
GetFontNr 
GetHistoryChars 
GetImageAtXY 
GetLineFromXY 
GetObjectFromXY 
GetPagesAsString 
GetPageXYfromXY 
GetPaperBins 
GetPar 
GetParXYBaselineScreen 
GetPointFromParLin 
GetPosition 
GetRTData 
GetRTFEngine 
GetSelectedCells 
GetSelPosLen 
GetStyleNameForNr 
GetStyleNrForName 
GetTextBuf 
GetTextLen 
GetTextScreenRect 
GetUNICODE 
GetXPositionTw 
GetYPositionTw 
HideParWithCondition 
HideSelection 
HyperlinkAtCP 
HyperlinkConvertOldWPT3Links 
HyperlinkMoveTo 
HyperlinkSelect 
IgnoreMouse 
ImageGetList 
InputCode 
InputEditField  Creates a new mail-merge or edit field.
InputField  InputField is not included in WPTools 6 - please use InputMergeField()
InputFootnote 
InputHyperlink 
InputMergeField  Creates a new mail-merge field.
InputNewObject 
InputObject 
InputParagraph 
InputSection 
InputSingleCode 
InputSpanObjects 
InputString 
InputStringInt 
InputStringW 
InputTextbox 
InputTextField 
InputTextFieldName 
InputTextProtection 
InsertColumn 
InsertPar 
InsertRow 
InsertRowAbove 
InTable 
Invalidate 
IsEmpty 
IsFirstLine 
IsLastLine 
IsSelected 
LoadCSSFile 
LoadCSSheet 
Loaded 
LoadFromBuffer 
LoadFromFile 
LoadFromStream 
LoadFromString 
LoadPropertiesFromDFM 
LoadSelectionFromStream 
LockScreen 
MergeActiveText 
MergeEnumFields 
MergeText 
MergeTextEx 
MovePosition 
MoveToCell 
MoveToField 
MoveToNextField 
MoveToPreviousField 
MoveToTable 
NewUndolevel 
NrToColor 
NumberStyles 
OnToolBarSelection 
OpenCodeAt 
OpenCodes 
OpenCodesAtCP 
OpenCodesAtCPDepth 
OpenDialog 
Paint 
PaintPageOnCanvas  Low level print function to print a page on any Canvas
PaintTo 
ParStyleCPMoveTo 
ParStyleLocateFirst 
ParStyleMarkForReformat 
ParStyleNormalizePar 
ParStylePaint 
ParStyles 
PasteAttr 
PasteFromClipboard 
PendingUpdate 
PopAttr 
Print 
PrintBottomPos 
Printing 
PrintPage 
PrintPageOnCanvas 
PrintPages 
ProcessDelayedUpdates 
ProcessScrollEvent 
PushAttr 
ReadHyperlink 
RecalcText 
Redo 
ReformatAll 
Refresh 
RefreshAniImages 
RemoveRTFData 
Repaint 
ReplaceTextMethod 
ReplaceTokens 
ReplaceTokensInAllTexts 
SaveChanging 
SaveCSSFile 
SaveCSSheet 
SaveSelectionToStream 
SaveToFile 
SaveToStream 
SaveToString 
ScreenToRTFPage 
ScrollLinePos 
ScrollToPosition 
SelectAll 
SelectCell 
SelectedTextAttr  Interface to change or read the properties of the selected text.
SelectFieldAtCP 
SelectLine 
SelectPage 
SelectPages 
SelectParagraph 
SelectThisCell 
SelectThisColumn 
SelectThisRow 
SelectThisTable 
SelectWord 
SetBorderProperties 
SetFocus 
SetFocusValues 
SetImageMode 
SetInnerCellBorders 
SetOuterCellBorders 
SetPosition 
SetPositionXY 
SetRTFData 
SetRTFDataOrProps 
SetScrollBarSize 
SetSelPosLen 
SetUNICODE 
SetZoom 
SetZoomMode 
ShowCursor 
Spell_FromCursorPos 
Spell_FromStart 
Spell_GetNextWord 
Spell_IgnoreWord 
Spell_RemoveMarkers 
Spell_ReplaceWord 
Spell_SelectWord 
Spell_SelectWordXY 
Spell_TopPosition 
SplitCells 
SplitCellsVertically 
SplitTable 
StartSpellCheck 
StartUndolevel 
StartUpdate 
TableAdd 
TableAdjustCellWidth 
TableFixAllCellWidths 
TableMakeCellWidthPC 
TabstopAdd 
TabstopClear 
TabstopDelete 
TextCursor 
TextHeight 
TextObjectsGetList 
TextWidth 
Undo 
UndoBufferSaveTo 
UndoClear 
UnLockScreen 
UpdateEditBox 
UpdatePrinterProperties 
WritingAttr  Attributes for newly typed in text.

Introduced Events
AfterCompleteWordEvent 
AfterCopyToClipboard 
AfterDelayedUpdate 
AfterLoadText 
AfterObjectSelection 
BeforeCopyText 
BeforeCutText 
BeforeDestroyPaintPage 
BeforeDropText 
BeforeEditBoxNeedFocus 
BeforeObjectSelection 
BeforeOverwriteFile 
BeforePaintLayer 
BeforePasteImage 
BeforePasteText 
BeforeResize 
OnActivateHint 
OnActivatingHotStyle 
OnCalcPageNr 
OnChange 
OnChangeCursorPos 
OnChangeLastFileName 
OnChangeSelection 
OnChangeViewMode 
OnChangeZooming 
OnClear 
OnClick 
OnClickCreateHeaderFooter 
OnClickHotText 
OnClickPage 
OnClickText 
OnDblClick 
OnDeactivateHotStyle 
OnDelayedUpdate 
OnDropFile 
OnEditBoxChangeHeight 
OnEditBoxChangeWidth 
OnEditStateChanged 
OnGetAttributeColor 
OnGetPageGapText 
OnInitializedRTFData This event can be used to assign the same TWPRTFProps object to different editors.
OnInitializeRTFDataObject 
OnInternPaintPar 
OnLeaveRTFDataBlock 
OnMailMergeGetText This event is triggered when the MergeText or MergeEnumFields procedure is used.
You can use the provided parameter inspname to select the required result string for the property Contents.StringValue.

Contents.StringValue := Table1.FieldByName(inspname).AsString;
OnMouseDownWord 
OnMouseEnter 
OnMouseLeave 
OnNewRTFDataBlock 
OnOpenDialog 
OnPaint 
OnPaintDesktopBackground 
OnPaintExternPage 
OnPaintPageHint 
OnPaintTextFrameRect 
OnPaintWatermark 
OnQueryDrag 
OnResize 
OnSearchReplaceMessage 
OnSetupPrinterEvent 
OnStartSpellCheck 
OnTestForLinkEvent 
OnTextObjectClick Error in DocComment
OnTextObjectDblClick 
OnTextObjectMouseDown 
OnTextObjectMouseMove 
OnTextObjectMouseUp 
OnTextObjectMove 
OnTextObjectMovePosition 
OnTextObjectPaint 
OnTextObjGetTextEx Error in DocComment
OnToolBarSelectionEvent 
OnUndoStateChanged 
OnUpdateExternScrollbar 
OnWorkOnTextChanged 


WPCubed