Cannot Position Cursor Within Text
Posted: Fri May 25, 2007 1:04 am
I'm using the workaround for being able to save styles in tables - i.e. saving to an intermediate TRichViewEdit that shares the same TRichViewStyle component at the final destination table (code at the bottom).
The problem is that when I then attempt to edit one of these cells the cursor cannot be positioned within the boudary of the first item. Words in the first item can be selected by double-clicking them but the cursor cannot be placed anywhere before the second item begins. If I select a word in the first item by double-clicking on it and, say, change its color, thus making this word the second item and words past this change the third item, EVERYTHING then behaves normally - including the remaining portion of what was the first item.
Could you give me some idea of what's wrong here?
try
MasterSecRVTable.Cells[i, 0].SaveRVFToStream(MemStream, False, clNone, nil, nil);
MemStream.Position := 0;
RichViewEdit3.LoadRVFFromStream(MemStream);
finally
MemStream.Clear;
end;
RichViewEdit3.Format;
try
RichViewEdit3.SaveRVFToStream(MemStream, False);
MemStream.Position := 0;
MasterRVTable.Cells[i + j, 1].AppendRVFFromStream(MemStream,-1,Dummy1,Dummy2);
finally
MemStream.Clear;
end;
The problem is that when I then attempt to edit one of these cells the cursor cannot be positioned within the boudary of the first item. Words in the first item can be selected by double-clicking them but the cursor cannot be placed anywhere before the second item begins. If I select a word in the first item by double-clicking on it and, say, change its color, thus making this word the second item and words past this change the third item, EVERYTHING then behaves normally - including the remaining portion of what was the first item.
Could you give me some idea of what's wrong here?
try
MasterSecRVTable.Cells[i, 0].SaveRVFToStream(MemStream, False, clNone, nil, nil);
MemStream.Position := 0;
RichViewEdit3.LoadRVFFromStream(MemStream);
finally
MemStream.Clear;
end;
RichViewEdit3.Format;
try
RichViewEdit3.SaveRVFToStream(MemStream, False);
MemStream.Position := 0;
MasterRVTable.Cells[i + j, 1].AppendRVFFromStream(MemStream,-1,Dummy1,Dummy2);
finally
MemStream.Clear;
end;