How to dump all text to a string buf with CR+LF?
because i want to split it with CR+LF,not the item.
and,if get one string line,how to get each item of the line?
How to get all text?
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
In order to include picture names, you need to modify GetItemText from this unit ("or (rv.GetItem(ItemNo) is TRVGraphicItemInfo)" is added):
The same change must be done in GetItemText2.
PS: This example assumes that the picture text (which you want to insert in string) is stored in the item name (the first parameter of InsertPicture, can be read by GetItemTextA, changed by SetItemTextA).
But probably you want to insert "alternative text", stored in rvespAlt property (this property was specially added to store a text representation of image). In this case, text for images must be retrieved using GetItemExtraStrProperty method.
Code: Select all
function GetItemText(rv: TCustomRichView; ItemNo: Integer): String;
begin
if (rv.GetItemStyle(ItemNo)>=0) or (rv.GetItem(ItemNo) is TRVGraphicItemInfo) then
Result := rv.GetItemTextA(ItemNo)
else if rv.GetItem(ItemNo).GetBoolValue(rvbpAlwaysInText) then
Result := rv.GetItem(ItemNo).AsText(0, rv.RVData, rv.GetItemText(ItemNo), '', True, False)
else
Result := '';
end;
PS: This example assumes that the picture text (which you want to insert in string) is stored in the item name (the first parameter of InsertPicture, can be read by GetItemTextA, changed by SetItemTextA).
But probably you want to insert "alternative text", stored in rvespAlt property (this property was specially added to store a text representation of image). In this case, text for images must be retrieved using GetItemExtraStrProperty method.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: