General TRichView support forum. Please post your questions here
jgkoehn
Posts: 303 Joined: Thu Feb 20, 2020 9:32 pm
Post
by jgkoehn » Fri Apr 16, 2021 4:21 pm
Greetings,
I am using
Code: Select all
FViewer.SetSelectionBounds(GStartItem+1,FViewer.GetOffsBeforeItem(GStartItem+1)+Length(GLinkStr),
GEndItem,FViewer.GetOffsAfterItem(GEndItem)-7);
But with tables this has a problem: However, I can't find TopLevelEditor like
Code: Select all
FViewer.TopLevelEditor.SetSelectionBounds(GStartItem+1,FViewer.GetOffsBeforeItem(GStartItem+1)+Length(GLinkStr),
GEndItem,FViewer.GetOffsAfterItem(GEndItem)-7);
Am I missing something?
jgkoehn
Posts: 303 Joined: Thu Feb 20, 2020 9:32 pm
Post
by jgkoehn » Fri Apr 16, 2021 5:37 pm
Basically I am working on copying content within a table and pasting it next to it
so
Code: Select all
<link>Content to copy</link>
<link>Content to copy</link>Copied to here
Sergey Tkachenko
Site Admin
Posts: 17569 Joined: Sat Aug 27, 2005 10:28 am
Contact:
Post
by Sergey Tkachenko » Mon Apr 19, 2021 8:40 am
TopLevelEditor is an editor containing the caret.
In viewer (TRichView), there is no caret, and there is no editor.
You can use table.Cells[r,c].SetSelectionBounds
(but before selecting in cell, call table.Cells[r,c].Edit, or table.EditCell(r,c), it is necessary even in a viewer)