Class TParagraph
Hierarchy
System.TObject | WPRTEDefs.TWPTextStyle | TParagraph
Description
This object stores the text. It is organzied in a linked list (NextPar/PrevPar) starting from TRTFData.FirstPar. Paragraphs can also contain sub paragraphs (ChildPar). NOTE: In WPTools V4 the list was created using the pointers next and prev. This properties still exists and can be used to enumberate all paragraphs (including child paragraphs) in their logical order.Like in Version 4 tables cells are handles a paragraphs. In contrast to previous versions WPTools 5 handles child paragraphs to support multiple paragraphs in the one table cell. Even tables can be inside a table cell - (but they will always start under, and not besides of normal text since they always start on a new line.)
Similar to WPTools 4 table rows work as a chain of paragraphs using IsLeft and IsRight flag. We decided not to use a special class to order the cells in a table (such as TWPTable.Rows[].Columns[]) since such a class has no advantages for the formatting of the text. It only introduces problems when tablrs have to be merged or splitted. Our approach handles each row on its own so a table merge or split is possible any time.
But this does not mean there is no Row[] and Cell[] array. This properties are available in each TParagraph which is part of a table.
Normally a Table starts with an empty paragraph and all rows are stored as child objects in this paragraph. The paragraph text is displayed above the rows as usually. In This case the Flag IsWPTable is true
Properties
Property AClass : string
Property ANSIChr[index] : AnsiChar
Property ANSIText : AnsiString
Property CellWidthTwips : Integer
Property CharMax : Integer
Property ChildPar : TParagraph
Property Children[index] : TParagraph
Property ChildrenCount : Integer
Property ColCount : Integer
Property ColFirst : TParagraph
Property ColNr : Integer
Property ColPrior : TParagraph
Property ColRight : TParagraph
Property cols[index] : TParagraph
Property ColsByName[index] : TParagraph
Property ColsByXOff[index] : TParagraph
Property ColSpan : Integer
Property ColXOffTw : Integer
Property CustomObjects[index] : TObject
Property CustomParameters : TStrings
Property EndSpanH : TParagraph
Property EndSpanV : TParagraph
Property FirstLine : Integer
Property FirstSibling : TParagraph
Property HasChildren : Boolean
Property Hidden : Boolean
Property id : Integer
Property indentfirst : Integer
Property indentleft : Integer
Property indentright : Integer
Property IsFirstTextPar : Boolean
Property IsLastTextPar : Boolean
Property IsNestedTable : Boolean
Property IsNewPage : Boolean
Property LastChild : TParagraph
Property LastInnerChild : TParagraph
Property LastLine : Integer
Property LastSibling : TParagraph
Property Level : Integer
Property LineCount : Integer
Property LoadedCharAttr : Cardinal
Property LogNextPar : TParagraph
Property LogPrevPar : TParagraph
Property MinCHeight : Integer
Property nextpardown : TParagraph
Property ObjectIndex[posinpar] : Integer
Property ObjectRef[posinpar] : TWPTextObj
Property PaddingL : Integer
Property ParagraphType : TWPParagraphType
Property ParentBand : TParagraph
Property ParentCell : TParagraph
Property ParentGroup : TParagraph
Property ParentPar : TParagraph
Property ParentParentGroup : TParagraph
Property ParentParentPar : TParagraph
Property ParentParentRow : TParagraph
Property ParentParentTable : TParagraph
Property ParentRow : TParagraph
Property ParentTable : TParagraph
Property ParLength : Integer
Property ParProtected : Boolean
Property RowCount : Integer
Property RowDownXLog : TParagraph
Property RowFirst : TParagraph
Property RowLogNr : Integer
Property RowMerge : Integer
Property rownr : Integer
Property RowPrior : TParagraph
Property rows[index] : TParagraph
Property RowSpan : Integer
Property RowUpXLog : TParagraph
Property RTFData : TWPRTFDataBlock
Property Sibling[index] : TParagraph
Property SiblingCount : Integer
Property SiblingNr : Integer
Property SourceTemplate : TParagraph
Property SourceTemplateIndex : Integer
Property spaceafter : Integer
Property spacebefore : Integer
Property spacebetween : Integer
Property StartSpan : TParagraph
Property TableCount : Integer
Property Tables[index] : TParagraph
Property template_rows[index] : TParagraph
Property TemplatePar : TParagraph
Property Text : string
Property WideText : WideString
Methods
Function _FixAllCellWidths(SnapValue:Integer) : Integer
Function _IsWidthTw : Integer
Procedure _SetMinMaxWidth(minw:Integer; maxw:Integer)
Procedure AddFlagAttr(A:Integer; B:Integer; Flag:Cardinal)
Procedure ADelColumn(WPAT_Code:Byte)
Procedure ADeleteEqualSettings(Style:TWPTextStyle)
Procedure ADelRecursive(WPAT_Code:Byte)
Function AdjustTableRow : Boolean
Function AGetAllColWidth : Integer
Function AGetAllInheritedFlags(WPAT_Code:Byte; Value:Integer) : Boolean
Procedure AGetBaseAndSpan(stack:TWPCharAttrStack; posinpar:Integer)
Function AGetFBBGCOlor(FGColor:Integer; BGColor:Integer) : Boolean
Function AGetInherited(WPAT_Code:Byte; Value:Integer) : Boolean
Function AGetInheritedEx(WPAT_Code:Byte; Value:Integer; BreakAtType:TWPParagraphTypes) : Boolean
Function AGetInheritedFromCell(WPAT_Code:Byte; Value:Integer) : Boolean
Function AGetInheritedFromPar(WPAT_Code:Byte; Value:Integer) : Boolean
Function AGetParKeep(N:Boolean) : Boolean
Function Append(obj:TWPTextObj; CharAttrIndex:Cardinal) : TParagraph
Procedure AppendChar(C:Char; A:TWPCharAttr)
Function AppendChild(Par:TParagraph) : TParagraph
Procedure AppendChildren(Par:TParagraph)
Function AppendInplaceEditor(InplaceClass:string; FieldWidth:Integer; FieldHeight:Integer; CharAttrIndex:Cardinal) : TWPTextObj
Function AppendNewCell(DontCopyStyle:Boolean; colspan:Integer) : TParagraph
Function AppendNewObject(ObjType:TWPTextObjType; HasClosing:Boolean; IsClosing:Boolean; CharAttrIndex:Cardinal) : TWPTextObj
Function AppendNewObjectPair(ObjType:TWPTextObjType; TextWithin:WideString; CharAttrIndex:Cardinal) : TWPTextObj
Function AppendNewPar(DontCopyStyle:Boolean) : TParagraph
Function AppendNewRow(DontCopyStyle:Boolean; LastRow:TParagraph) : TParagraph
Function AppendNewTable(DontCopyStyle:Boolean) : TParagraph
Function AppendObject(wpobjclass:string; CharAttrIndex:Cardinal) : TWPTextObj
Function AppendParagraphAsNext(DontCopyStyle:Boolean) : TParagraph
Function AppendPropertyGrid(Level:TAppendPropertyGridMode; aTitle:string; aName:string; Options:TAppendPropertyGridOptions; ColumnWidth:Integer; InplaceClass:string; ModifyCellCallback:TWPAppendGridCallback; Data:TObject) : TParagraph
Function AppendPropertyRow(aCaption:string; aName:string; Options:TAppendPropertyGridOptions; InplaceClass:string; FieldCommand:string; ColumnWidth:Integer; ModifyCellCallback:TWPAppendGridCallback; PropertyColCount:Integer) : TParagraph
Function AppendTextObject(aName:string; CharAttrIndex:Cardinal; aText:string; aRenderMode:TWPTextObjTextRenderMode) : TWPTextObj
Procedure AppendTree(SourceParagraphs:TParagraph)
Function ApplyZOrderInTextObjIParam : Boolean
Function AsChildOfPreviousPar : TParagraph
Procedure ASetAttrInAllCharsAttr(Code:Integer; Value:Integer)
Procedure ASetCharStyleRecursive(Flag:TThreeState; WPSTY_Value:Integer)
Procedure ASetColumn(WPAT_Code:Byte; Value:Integer)
Procedure ASetColumnWidth(CurrValue:Integer; NewValue:Integer; OnlyThisRow:Boolean)
Procedure ASetColumnWidthPC(WidthPC:Integer; DistributeToAll:Boolean; OnlyThisRow:Boolean)
Procedure ASetNeutral(WPAT_Code:Byte; Value:Integer)
Procedure ASetRecursive(WPAT_Code:Byte; Value:Integer)
Procedure ASetRow(WPAT_Code:Byte; Value:Integer)
Function AsNumber(DecSep:Char) : Double
Function CalcBorderLeftRightIndent(leftind:Integer; rightind:Integer) : Boolean
Function CalcMinimumWidth(maximum:Integer) : Integer
Function CalculateTableGrid(needxpos:Boolean; grid:TList) : Boolean
Function CharAtIs(p:Integer; cv:Char) : Boolean
Function CharCountAll : Integer
Function CheckTable(HeaderRow:TParagraph; FooterRow:TParagraph; AddRowSpanProp:Boolean) : Boolean
Function ChildParagraph : TParagraph
Procedure ClearCharAttr(ClearParAttrToo:Boolean)
Procedure ClearCharAttributes(ClearParAttrToo:Boolean)
Procedure ClearText(ChildrenToo:Boolean)
Function Compare(StartIndex:Integer; text:string; CaseSensitive:Boolean) : Boolean
Function CompareW(StartIndex:Integer; text:WideString; CaseSensitive:Boolean) : Boolean
Function Contains(Par:TParagraph) : Boolean
Function ContainsText(IgnoreObjects:TWPTextObjTypes) : Boolean
Procedure CopyChar(SourceIndex:Integer; Dest:TParagraph; DestIndex:Integer)
Procedure CopyCharAndClear(SourceIndex:Integer; Dest:TParagraph; DestIndex:Integer)
Procedure CopyText(Dest:TParagraph; DestIndex:Integer)
Function CPOfPos(posinpar:Integer) : Integer
Create(RTFData:TWPRTFDataBlock)
Function CreateCopy(NewRTFDataBlock:TWPRTFDataBlock; SkipObjects:TWPTextObjTypes; AssignTemplate:Boolean) : TParagraph
Function CreateCopyList(CopyText:Boolean; UntilSibling:TParagraph; modes:TWPCopyParModes) : TParagraph
Function CreateInplaceEditor(InplaceClass:string) : TWPToolsInplaceEditorAbstractBase
Function CreateMergedCells : Boolean
Function CreateRow(AfterRow:TParagraph; AppendAtEnd:Boolean) : TWPTableRowStyle
Function CreateTable(AfterPar:TParagraph) : TParagraph
Function CurrentSection : TWPRTFSectionProps
Function CurrentSectionID : Integer
Function DeleteChar(Index:Integer) : Boolean
Function DeleteChars(Index:Integer; Count:Integer) : Boolean
Function DeleteMarkedChar(ChildrenToo:Boolean) : Boolean
Function DeleteParagraph : TParagraph
Function DeleteParagraphEnd : Boolean
Function DeleteParagraphKeepChildren : TParagraph
Function DeleteParagraphWithUndo : TParagraph
Procedure DeleteWPTextObj(Index:Integer)
Procedure DelFlagAttr(A:Integer; B:Integer; Flag:Cardinal)
Function depth : Integer
Function DetatchNextPar(NewRTFData:TWPRTFDataBlock) : TParagraph
Function Duplicate(CopyText:Boolean; CopyChildren:Boolean; LinkBefore:Boolean; modes:TWPCopyParModes) : TParagraph
Function EndRow(row:TWPTableRowStyle) : TParagraph
Procedure Exchange(CharPos1:Integer; CharPos2:Integer)
Function ExcludeProp(Flag:TParOneProp) : Boolean
Procedure ExcludeProps(Flags:TParProp)
Function FirstLevelPar : TParagraph
Function FixAllCellWidths(SnapValue:Integer) : Integer
Function FixTableWidth : Boolean
Function FontSizeAtPosition(x:Integer) : Integer
Function GetAllText(ObjectSymbol:Boolean; NumberText:Boolean) : WideString
Function GetCell(rownr:Integer; colnr:Integer) : TParagraph
Function GetCharAttr(posinpar:Integer) : Cardinal
Function GetCharAttrInterface(posinpar:Integer) : TWPAbstractCharAttrInterface
Function GetCharCount(aThisPar:Boolean; bChildrenPar:Boolean) : Integer
Function GetChildrenAsList : TWPParagraphList
Function GetDebugTreeString : string
Function GetEditLink(editlink:IWPEditLinkCheck) : Boolean
Function GetFirstCharAttr : Cardinal
Function GetLineCount(aThisPar:Boolean; bChildrenPar:Boolean) : Integer
Function GetLineText(LineNr:Integer) : WideString
Function GetMultibyteText(Codepage:Integer) : AnsiString
Function GetNumberStyleEx(numlevel:Integer; SkipNumber:Boolean; ele:TWPRTFNumberingStyle) : TWPTextStyle
Function GetNumberText(NumberStyle:TWPTextStyle; IgnoreUsePrev:Boolean) : WideString
Procedure GetObjList(Mask:TWPTextObjTypes; list:TList; LastChildPar:TParagraph; RequiredName:string)
Function GetParentRow(row:TParagraph) : Boolean
Function GetRowNext(BestColNr:Integer) : TParagraph
Function GetRowPrior(BestColNr:Integer) : TParagraph
Function GetRTLCursorPos(position:Integer; x:Integer; h:Integer; w:Integer) : Boolean
Function GetSubText(posinpar:Integer; len:Integer; ExcludeObjCodes:Boolean) : WideString
Function GetText(ObjectSymbol:Boolean; NumberText:Boolean; SimpleHTML:Boolean) : string
Function GetWordOffset(x:Integer) : Integer
Function GetWPTextObj(Index:Integer) : TWPTextObj
Function globalnext : TParagraph
Function globalNextPar : TParagraph
Function GridActivate(gridname:string; DefaultRowHeight:Integer; MaxDatarowCount:Integer) : Boolean
Function GridUpdate(mode:TWPGridUpdateModes; adapter:TWPDataSetAbstractAdapter) : Boolean
Function HasAttr : Boolean
Function HasObjects(AllTypes:Boolean; TypeSelection:TWPTextObjTypes) : Boolean
Function HasParent(aParentPar:TParagraph) : Boolean
Function HasProp(Flag:TParOneProp) : Boolean
Function HasText(s:string; AlsoCheckChildren:Boolean; CaseSensitive:Boolean) : Boolean
Function HasTextW(w:WideString; AlsoCheckChildren:Boolean; IgnoreCase:Boolean) : Boolean
Function Height(UseSpacing:Boolean) : Integer
Function HeightEx(depth:Integer; UseSpacing:Boolean; MeasureFirstCharOnly:Boolean) : Integer
Function HeightFN : Integer
Function HeightKeepN(UseSpacing:Boolean) : Integer
Function HeightMin(UseSpacing:Boolean) : Integer
Function HeightTotal : Integer
Procedure HideInplaceEditors(HideEditors:Boolean)
Function IDPTR : Cardinal
Function InbetweenObjects(pos:Integer; ObjTypes:TWPTextObjTypes) : TWPTextObj
Function IncludeProp(Flag:TParOneProp) : Boolean
Procedure IncludeProps(Flags:TParProp)
Function InplaceEditor : TWPToolsInplaceEditorAbstractBase
Function Insert(Index:Integer; TxtObject:TWPTextObj; CharAttrRec:TWPCharAttr; ObjChar:Char) : Integer
Function InsertEx(Index:Integer; text:WideString; CharAttrIndex:Cardinal) : TParagraph
Function InsertNewObject(Index:Integer; ObjType:TWPTextObjType; HasClosing:Boolean; IsClosing:Boolean; CharAttrIndex:Cardinal) : TWPTextObj
Function InsertQuickly(Index:Integer; text:WideString; CharAttrIndex:Cardinal) : Integer
Function IsCell : Boolean
Function IsCharObject(pos_in_par:Integer) : Boolean
Function IsCharStyle(posinpar:Integer; WPSTY_Flag:Integer) : Boolean
Function IsEmptyWithEmptyChildren : Boolean
Function IsFirstPar : Boolean
Function IsHeaderRow : Boolean
Function IsLastPar : Boolean
Function IsLinkDelimiter(pos_in_par:Integer) : Boolean
Function IsLowercase(pos_in_par:Integer) : Boolean
Function IsNonABC(pos_in_par:Integer) : Boolean
Function IsNonSpace(IgnoredObjTypes:TWPTextObjTypes; IgnoreChildren:Boolean) : Boolean
Function IsNum(posinpar:Integer) : Boolean
Function IsNumber : Boolean
Function IsParProtected(value:Integer) : TParagraph
Function IsPunctation(pos_in_par:Integer) : Boolean
Function IsRTL(pos_in_par:Integer; DefaultValue:Boolean) : Boolean
Function IsSpace(pos_in_par:Integer) : Boolean
Function IsTable : Boolean
Function IsUppercase(pos_in_par:Integer) : Boolean
Function IsWordDelimiter(pos_in_par:Integer) : Boolean
Function LastChar(DeleteIt:Boolean; DefaultChar:Char) : Char
Procedure LimitCPToLineLength(lin:Integer; CP:Integer)
Procedure LimitLines(Count:Integer)
Function LineAllCount : Integer
Function LineEndOffset(lin:Integer) : Integer
Function LineHeight(lin:Integer) : Integer
Function LineIsLast(lin:Integer) : Boolean
Function LineLength(lin:Integer) : Integer
Function LineOffset(lin:Integer) : Integer
Function LineOfPos(posinpar:Integer; FavourizeEnd:Boolean) : Integer
Function LinePageNr(lin:Integer) : Integer
Function LinePosFromX(lin:Integer; x:Integer; Found:Boolean) : Integer
Function LineStartNr : Integer
Function LineXFromPos(lin:Integer; CP:Integer; w:Integer) : Integer
Function LineYFromPos(lin:Integer) : Integer
Function LoadFromFile(FileName:string; Format:string; Options:TWPParLoadOptions) : Boolean
Function LocateNextChar(Par:TParagraph; posinpar:Integer) : Boolean
Function LocatePrevChar(Par:TParagraph; posinpar:Integer) : Boolean
Procedure LowLevelRemoveFromList
Procedure MakeLine(Index:Integer; ParLineData:TLine)
Procedure MergeCell(KeepMergedColumn:Boolean)
Procedure MoveChar(SourceIndex:Integer; Count:Integer; Dest:TParagraph; DestIndex:Integer)
Function MoveChildrenBelow : TParagraph
Function MoveChildrenToTemplate(Source:TParagraph; CreateRowGroup:Boolean; GroupLevel:Integer) : TParagraph
Function MoveTemplateToChildren : TParagraph
Function NeedAttr : Boolean
Function NeedCharPos : Boolean
Function nextcell : TParagraph
Function NextLine(lin:Integer) : Boolean
Function OpenObjectAt(posinpar:Integer; ObjType:TWPTextObjType) : TWPTextObj
Function Overwrite(Index:Integer; text:WideString; CharAttrIndex:Cardinal) : Integer
Function paprIsLeftPar : Boolean
Function paprIsRightPar : Boolean
Function ParagraphLines : Integer
Procedure ParagraphObjAdd(obj:TCustomParagraphObj)
Function ParagraphObjCount : Integer
Procedure ParagraphObjDel(obj:TCustomParagraphObj)
Function ParagraphObjFind(Typ:Integer) : TCustomParagraphObj
Function ParagraphObjGet(Index:Integer) : TCustomParagraphObj
Function ParentCellFromTable(Table:TParagraph) : TParagraph
Function ParentSubPar : TParagraph
Function ParNr : Integer
Function position : Integer
Function PositionOfObject(obj:TWPTextObj) : Integer
Function PosOf(s:string; CaseSensitive:Boolean) : Integer
Function PosOfCP(CurrPos:Integer; CP:Integer) : Integer
Procedure PrependChildren(Par:TParagraph)
Function PrependNewPar(DontCopyStyle:Boolean) : TParagraph
Function prevcell : TParagraph
Function PrevLine(lin:Integer) : Boolean
Function Reformat(Always:Boolean; maxw:Integer; Options:Integer) : Integer
Function ReformatTableFrame : Boolean
Procedure Replace(posinpar:Integer; len:Integer; NewText:string)
Procedure ReplaceW(posinpar:Integer; len:Integer; NewText:WideString)
Function RowAppend : TParagraph
Function SaveToStream(Stream:TStream; OnlyChildren:Boolean; Format:string) : Boolean
Function SaveToString(OnlyChildren:Boolean; Format:string) : string
Procedure SetAllText(text:WideString; aindex:Integer)
Procedure SetCapacity(max:Integer)
Procedure SetCharAttr(posinpar:Integer; Value:Cardinal)
Procedure SetCharAttrInText(Value:Cardinal)
Procedure SetChildrenFromList(list:TWPParagraphList)
Function SetColorProperty(WPAT_Code:Byte; Value:TColor) : TParagraph
Procedure SetInplaceEditorIProp(WPINPL_ID:Integer; Value:Integer; Recursive:Boolean)
Function SetProperty(WPAT_Code:Byte; Value:Integer) : TParagraph
Procedure SetRTFData(NewRTFData:TWPRTFDataBlock; NewRTFProps:TWPRTFProps)
Procedure SetRTLCursorPos(position:Integer; Value:Integer; Wid:Integer; IsRTL:Boolean)
Function SetStringProperty(WPAT_Code:Byte; Value:string) : TParagraph
Procedure SetStyle(Element:TWPRTFStyleElement; ClearParStyles:Boolean; ClearCharStyles:Boolean)
Function SetText(text:WideString; aindex:Integer) : TParagraph
Function SetTextObject(aName:string; aText:string; aRenderMode:TWPTextObjTextRenderMode; CharAttrIndex:Cardinal) : TWPTextObj
Function SplitAt(posinpar:Integer; WithUNDO:Boolean) : TParagraph
Function SplitCell(posinpar:Integer; Mode:TWPSplitCellMode) : TParagraph
Function SplitParListBefore : TParagraph
Function SplitRow(mode:TWPSplitRowMode) : TParagraph
Function SplitTable(BeforeRow:Boolean) : TParagraph
Function StartNewSection(with_undo:Boolean) : TWPRTFSectionProps
Function StartWith(s:string; CaseSensitive:Boolean) : Boolean
Function StartWithW(s:WideString) : Boolean
Function SubPar(pos_in_subpar:Integer) : TParagraph
Function TableDepth : Integer
Function TableFrame : TWPTableFrame
Function TextAreaWidth : Integer
Function TotalLength : Integer
Function UnlinkParagraph : TParagraph
Function UnlinkParagraphList : TParagraph
Function UnlinkParagraphListGetNextPar : TParagraph
Procedure UpdateTableMinMaxWidth(PageWidth:Integer)
Function XFromPosInPar(posinpar:Integer) : Integer
Function YFromPosInPar(posinpar:Integer) : Integer