Page 1 of 1
How to get all text?
Posted: Wed Mar 29, 2006 11:41 am
by OldHawk
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?
Posted: Wed Mar 29, 2006 2:29 pm
by Sergey Tkachenko
For example, you can use GetAllText from RVGetText.pas:
function GetAllText(rv: TCustomRichView): String;
As for the second question, I need more details to answer.
Posted: Thu Mar 30, 2006 12:23 am
by OldHawk
thanks,i`m waiting for...
Posted: Thu Mar 30, 2006 12:31 am
by OldHawk
hi,GetAllText return string with no picture`s name? i want get it too.
Posted: Thu Mar 30, 2006 7:33 am
by Sergey Tkachenko
In order to include picture names, you need to modify GetItemText from this unit ("or (rv.GetItem(ItemNo) is TRVGraphicItemInfo)" is added):
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;
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.
Posted: Thu Mar 30, 2006 7:41 am
by Sergey Tkachenko
About the second question. I wanted additional information from you
Generally, it's not possible to restore items from text.