trichview.support
Re: How to find the style of each character |
Author |
Message |
Sergey Tkachenko |
Posted: 06/22/2002 18:14:49 Look at this part of this procedure: > if rv.GetItemStyle(j)>=0 then > Result := Result + rv.GetItemText(j) It adds a new portion of text (rv.GetItemText(j)) to the result. This portion of text has style rv.GetItemStyle(j) (this value is an index in the collection of text styles) > function GetTextFromParagraph(rv: TCustomRichView; ParagraphIndex: Integer): > String; > var i,j: Integer; > begin > Result := ''; > for i := 0 to rv.ItemCount-1 do begin > if rv.IsParaStart(i) then > dec(ParagraphIndex); > if ParagraphIndex<0 then begin > for j := i to rv.ItemCount-1 do begin > if (j>i) then begin > if rv.IsParaStart(j) then > break; > if rv.IsFromNewLine(j) then > Result := Result+#13; > end; > if rv.GetItemStyle(j)>=0 then > Result := Result + rv.GetItemText(j) > end; > break; > end; > end; > end; > |
Powered by ABC Amber Outlook Express Converter