SRichViewEdit synchronization text content id differs Item
Posted: Mon Dec 09, 2013 7:52 am
I have a RVF model, and there are many space unerline which let user input.
and every Underline has only tag flag; when user input text on a underline,and i wannt another Unerline Item has same text content automatically. can it impossible?
and i write code at SRichViewEdit.OnItemTextEdit().
and code below:
But the resulting is not good.
one: the another underline length can't perfect change automatically
two: and another underline text word space so near,and word overlapping.
two: can it impossible above my description
ps: my english just poor, i don't know if you can unerstand mean above. if you see.pls help.thanks.
and every Underline has only tag flag; when user input text on a underline,and i wannt another Unerline Item has same text content automatically. can it impossible?
and i write code at SRichViewEdit.OnItemTextEdit().
and code below:
Code: Select all
procedure TProModel.SRichViewEdit1ItemTextEdit(Sender: TCustomRichViewEdit;
const OldText: TRVRawByteString; RVData: TCustomRVData; ItemNo: Integer;
var NewTag, NewStyleNo: Integer);
var
cTag, cTag1, cFlag, cFlag1, cText: string;
I, L: integer;
//Item: TCustomRVFontInfo;
begin
cTag := PChar(RVData.GetItemTag(ItemNo));
L := Length(cTag) - Pos('-', cTag);
cFlag := Copy(ctag,Pos('-', cTag) + 1,L);
cText := RVData.GetItemText(ItemNo);
for I := 0 to SRichViewEdit1.RichViewEdit.ItemCount - 1 do
begin
cTag1 := PChar(SRichViewEdit1.RichViewEdit.GetItemTag(I));
if cTag1 = cTag then
Continue;
L := Length(cTag1) - Pos('-', cTag1);
cFlag1 := Copy(cTag1,Pos('-', cTag1) + 1,L);
if SameText(cFlag, cFlag1) then
SRichViewEdit1.RichViewEdit.SetItemTextW(I, cText);
end;
end;
one: the another underline length can't perfect change automatically
two: and another underline text word space so near,and word overlapping.
two: can it impossible above my description
ps: my english just poor, i don't know if you can unerstand mean above. if you see.pls help.thanks.