|
TCustomRichView.GetLineNo |
Top Previous Next |
|
Returns line of the position specified by ItemNo and ItemOffs. function GetLineNo(ItemNo, ItemOffs: Integer): Integer; (introduced in version 1.7) Parameters ItemNo – index of the item, in range from 0 to ItemCount-1. ItemOffs – offset in item. For non-text items, ItemOffs=0 specifies position before the item, ItemOffs=1 specifies position after the item (this is not important for this function, because non-text item cannot be placed on several lines). For text items, ItemOffs specifies position before the ItemOffs-th character:
Return value Line index. The first line has index 1. Number of lines depends on word-wrapping. Example: with MyRichView do r := GetLineNo(ItemCount-1, GetOffsAfterItem(ItemCount-1)) r receives number of lines in MyRichView.
Warning: this function contains calculations inside, and it may take a while to execute it. (There is an idea how to make it lightning-fast in future, but it will be implemented later).
This method must be called only when the document is formatted.
See also: See also methods of TCustomRichViewEdit: |