http://www.trichview.com/support/files/listofnotes.zip
This is a modification of Demos\Delphi\Editors\Notes\ demo
Two new commands are added in the Notes menu:
- Edit List of Foonotes...
- Edit List of Endnotes...
These commands open a dialog window where you can edit all notes in a table.
This example assumes that StyleTemplates are not used. We can create a demo with StyleTemplates on request.
Updates:
2018-Apr-18: for compatibility with TRichView 17
[Demo] Editing a list of foonotes/endnotes
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
nice demo that is almost what I need, but is there any way to avoid the cursor to go outside the table ?
let's add some notes, go to the editor, click on a note and start selecting text with Shift+RightArrow; when you reach the end of line the cursor leaves the cell and go to the right of the table :/
let's add some notes, go to the editor, click on a note and start selecting text with Shift+RightArrow; when you reach the end of line the cursor leaves the cell and go to the right of the table :/
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Sorry for the delay.
In this demo, you can place the caret before or after the table, but it does not allow typing there (because the table is inserted in a read-only paragraph).
If you do not like it, you can process OnCaretMove, and when the caret is outside the table, move it back. I'll make an example later in this week.
In this demo, you can place the caret before or after the table, but it does not allow typing there (because the table is inserted in a read-only paragraph).
If you do not like it, you can process OnCaretMove, and when the caret is outside the table, move it back. I'll make an example later in this week.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
How to prevent the caret moving outside the table of notes.
Open NoteListFrm.pas.
1) Add in the interface section, in "uses": CRVData;
2)Add in the interface section:
2) Add in the declaration of TfrmNoteList:
4) Add rveCaretMove handling rve.OnCaretMove.
3) Add in the implementation:
Open NoteListFrm.pas.
1) Add in the interface section, in "uses": CRVData;
2)Add in the interface section:
Code: Select all
const WM_BACKTOTABLE = WM_USER+1;
Code: Select all
Cell: TRVTableCellData;
ItemNo, Offs: Integer;
Moving: Boolean;
procedure WMBackToTable(var Msg: TMessage); message WM_BACKTOTABLE;
3) Add in the implementation:
Code: Select all
procedure TfrmNoteList.rveCaretMove(Sender: TObject);
begin
if not Visible or Moving then
exit;
if (rve.InplaceEditor=nil) and not (rvstCreatingInplace in rve.RVData.State) then begin
PostMessage(Handle, WM_BACKTOTABLE, 0, 0);
exit;
end;
if rve.InplaceEditor=nil then
exit;
Cell := rve.TopLevelEditor.RVData.GetSourceRVData as TRVTableCellData;
ItemNo := rve.TopLevelEditor.CurItemNo;
Offs := rve.TopLevelEditor.OffsetInCurItem;
end;
procedure TfrmNoteList.WMBackToTable(var Msg: TMessage);
var RVData: TCustomRVFormattedData;
begin
if not Visible or (rve.InplaceEditor<>nil) or (Cell=nil) then
exit;
Moving := True;
try
rve.RVData.State := rve.RVData.State - [rvstMakingSelection, rvstLineSelection];
RVData := Cell.Edit as TCustomRVFormattedData;
RVData.SetSelectionBounds(ItemNo, Offs, ItemNo, Offs);
finally
Moving := False;
end;
end;
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I moved the further discussion to http://www.trichview.com/forums/viewtopic.php?t=6905