How to add/ delete bookmarks or checkpoints (user defined)
-
- Posts: 67
- Joined: Sat May 13, 2006 1:56 pm
- Location: Australia
How to add/ delete bookmarks or checkpoints (user defined)
Hi,
I would like to
add/ delete bookmarks or checkpoints (user defined) to a form which opens
unicode text/rtf document or ebook.
So if I used text to speech to read a document user can keep a record of where they got to or are up to in the text.
Also, if reader is actually reading something they can keep a record of where they are if they close the program and reopen it later.
I would like to
add/ delete bookmarks or checkpoints (user defined) to a form which opens
unicode text/rtf document or ebook.
So if I used text to speech to read a document user can keep a record of where they got to or are up to in the text.
Also, if reader is actually reading something they can keep a record of where they are if they close the program and reopen it later.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
If you only needs to store a position, you can store the value of FirstItemVisible. After opening, get coordinates of this item (GetItemCoords) and scroll to it (ScrollTo).
If you want to work with checkpoints in TRichViewEdit, you can use the methods: InsertCheckpoint, RemoveCheckpointAtCaret, GetCheckpointAtCaret.
(alternatively, you can use SetCurrentCheckpointInfo, RemoveCurrentCheckpoint, GetCurrentCheckpoint, but the first group of methods is better)
If you want to work with checkpoints in TRichView, use AddNamedCheckpoint and RemoveCheckpoint.
See http://www.trichview.com/help/checkpoints_overview.html
If you want to work with checkpoints in TRichViewEdit, you can use the methods: InsertCheckpoint, RemoveCheckpointAtCaret, GetCheckpointAtCaret.
(alternatively, you can use SetCurrentCheckpointInfo, RemoveCurrentCheckpoint, GetCurrentCheckpoint, but the first group of methods is better)
If you want to work with checkpoints in TRichView, use AddNamedCheckpoint and RemoveCheckpoint.
See http://www.trichview.com/help/checkpoints_overview.html
-
- Posts: 67
- Joined: Sat May 13, 2006 1:56 pm
- Location: Australia
Demo project which shows this feature ?
I am a person with more ideas than time....
It would be much appreciated if there was a demo project to study.
thanks
Richard
It would be much appreciated if there was a demo project to study.
thanks
Richard
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
See Editors\Editor 1\ demo.
It allows adding, editing and deleting checkpoints. Menu Edit | Checkpoint, or a context menu.
This demo uses SetCurrentCheckpointInfo, RemoveCurrentCheckpoint, GetCurrentCheckpoint method. I recommend to change them to InsertCheckpoint, RemoveCheckpointAtCaret, GetCheckpointAtCaret.
It allows adding, editing and deleting checkpoints. Menu Edit | Checkpoint, or a context menu.
This demo uses SetCurrentCheckpointInfo, RemoveCurrentCheckpoint, GetCurrentCheckpoint method. I recommend to change them to InsertCheckpoint, RemoveCheckpointAtCaret, GetCheckpointAtCaret.
-
- Posts: 67
- Joined: Sat May 13, 2006 1:56 pm
- Location: Australia
OK, where is help for how to use InsertCheckpoint ?
I looked at the demo.
I am confused about what to do......
I can see that I can add a menu item called InsertCheckpoint, but that is all I don't know what code to add to the onclick event because there is no demo.
I looked at help and now
I am still confused....
Can I please see a working demo.
I am confused about what to do......
I can see that I can add a menu item called InsertCheckpoint, but that is all I don't know what code to add to the onclick event because there is no demo.
I looked at help and now
I am still confused....
Can I please see a working demo.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Do you have problems locating the source code of this demo?
For the trial version, source code of demos is in "Demo" folder of
http://www.trichview.com/rvfiles/rvhelp.zip
Open the appropriate subfolder of this "Demo" folder
("Delphi" contains demos for Delphi 4-2007, "DelphiUnicode" for Delphi 2009-2010, "CBuilder" for C++Builder 6-2007, "CBuilderUnicode" for C++Builder 2009-2010). In this subfolder, you can find the source code of this demo in "Editors\Editor 1" directory.
In this demo, open Unit1.pas (or Unit1.cpp for C++Builder), and find
procedure TForm1.mitEditCheckpointClick.
This procedure contains code for working this checkpoints.
For the trial version, source code of demos is in "Demo" folder of
http://www.trichview.com/rvfiles/rvhelp.zip
Open the appropriate subfolder of this "Demo" folder
("Delphi" contains demos for Delphi 4-2007, "DelphiUnicode" for Delphi 2009-2010, "CBuilder" for C++Builder 6-2007, "CBuilderUnicode" for C++Builder 2009-2010). In this subfolder, you can find the source code of this demo in "Editors\Editor 1" directory.
In this demo, open Unit1.pas (or Unit1.cpp for C++Builder), and find
procedure TForm1.mitEditCheckpointClick.
This procedure contains code for working this checkpoints.
-
- Posts: 67
- Joined: Sat May 13, 2006 1:56 pm
- Location: Australia
NOW I see what you are talking about
first you have to go to the 'Edit' menu and go down to item 'checkpoint' and click it.
Then you have the option to add a checkpoint.
BEFORE CLICKING 'ADD' BUTTON YOU CAN
A)MOVE THE CURSOR TO THE POINT IN THE TEXT YOU WISH TO BOOKMARK
B) THEN GIVE THE BOOKMARK A NAME.
Then if you go to the 'Misc' Menu and go down and click 'Go to checkpoint'
you can select the checkpoint you want to move to.
Many thanks Sergey !
I am not confused anymore.
Then you have the option to add a checkpoint.
BEFORE CLICKING 'ADD' BUTTON YOU CAN
A)MOVE THE CURSOR TO THE POINT IN THE TEXT YOU WISH TO BOOKMARK
B) THEN GIVE THE BOOKMARK A NAME.
Then if you go to the 'Misc' Menu and go down and click 'Go to checkpoint'
you can select the checkpoint you want to move to.
Many thanks Sergey !
I am not confused anymore.
-
- Posts: 67
- Joined: Sat May 13, 2006 1:56 pm
- Location: Australia
I found another problem with 'go to checkpoint'
Hi,
I just noticed if I turn the project off and restart it the saved checkpoints I added are missing.
How do I get the project/program to retain newly saved checkpoints even if the program is turned off and then restarted.
I just noticed if I turn the project off and restart it the saved checkpoints I added are missing.
How do I get the project/program to retain newly saved checkpoints even if the program is turned off and then restarted.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 67
- Joined: Sat May 13, 2006 1:56 pm
- Location: Australia
I USED THE EDITOR 1 DEMO
Hi Sergey,
I got this result using the Editor 1 demo..
C:\Program Files\Embarcadero\RAD Studio\7.0\lib\1-TRichView\Demos\DelphiUnicode\Editors\Editor 1
I WAS WONDERING IF AN INI FILE WOULD NEED TO BE CREATED TO SAVE/LOAD THE CHECKPOINTS ?
I got this result using the Editor 1 demo..
C:\Program Files\Embarcadero\RAD Studio\7.0\lib\1-TRichView\Demos\DelphiUnicode\Editors\Editor 1
I WAS WONDERING IF AN INI FILE WOULD NEED TO BE CREATED TO SAVE/LOAD THE CHECKPOINTS ?
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
No, checkpoints are saved directly in RVF/RTF file, additional INI files are not required.
May be you did not save a modified file?
I just tried - added a new checkpoint, then saved the file as RVF (File | Save & Export), then loaded this file (File | Load & Import), and the new checkpoint was loaded.
This demo does not autosave files, and it does not ask to save a modified file. It only saves and loads when you run the commands of menu "File".
If you need to implement the standard New, Open, Save, Save As commands and prompt to save a modified document on exit, see the "Editor 2" demo. Or use RichViewActions.
May be you did not save a modified file?
I just tried - added a new checkpoint, then saved the file as RVF (File | Save & Export), then loaded this file (File | Load & Import), and the new checkpoint was loaded.
This demo does not autosave files, and it does not ask to save a modified file. It only saves and loads when you run the commands of menu "File".
If you need to implement the standard New, Open, Save, Save As commands and prompt to save a modified document on exit, see the "Editor 2" demo. Or use RichViewActions.
-
- Posts: 67
- Joined: Sat May 13, 2006 1:56 pm
- Location: Australia
Another new problem...
OK I get or understand that I must first save the file before closing the program now, But now I get 2 new problems.
First I select the word Control then copy..
To set a checkpoint I go to menu...
Edit >>> Checkpoint
I paste the clipboard memory word "Control" into the
Name window
I enter "1" as the tag number then I click 'add'
I then goto menu
'Misc' >>> 'Go to Checkpoint'
I see the newly added checkpoint in the window.
I select the 'controls' checkpoint
then I click 'go to' button and this works fine.
If I save/export to the readme.rvf file with the new checkpoint/s
it prompts me to replace it.
I select yes.
I close the program.
I re-open the program.
If I then goto menu
'Misc' >>> 'Go to Checkpoint'
The newly added checkpoints are not there ! But they should be.
Also, if I try to Load & Import any saved RVF file I get error message
"Error during Loading"
First I select the word Control then copy..
To set a checkpoint I go to menu...
Edit >>> Checkpoint
I paste the clipboard memory word "Control" into the
Name window
I enter "1" as the tag number then I click 'add'
I then goto menu
'Misc' >>> 'Go to Checkpoint'
I see the newly added checkpoint in the window.
I select the 'controls' checkpoint
then I click 'go to' button and this works fine.
If I save/export to the readme.rvf file with the new checkpoint/s
it prompts me to replace it.
I select yes.
I close the program.
I re-open the program.
If I then goto menu
'Misc' >>> 'Go to Checkpoint'
The newly added checkpoints are not there ! But they should be.
Also, if I try to Load & Import any saved RVF file I get error message
"Error during Loading"
-
- Posts: 67
- Joined: Sat May 13, 2006 1:56 pm
- Location: Australia
I have noticed a similar problem with Editor2 .. It does not
When I try to save files with Editor 2 they do not save correctly.
When I save an open RVF file in Editor 2 with a new name and then open the
the new file after re-opening the original file the new file seems to be truncated or shortened.
Any help is always appreciated
When I save an open RVF file in Editor 2 with a new name and then open the
the new file after re-opening the original file the new file seems to be truncated or shortened.
Any help is always appreciated
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I received your demo.
Are you sure that you saved README.RVF in the directory of this demo, not in another directory?
In your zip file, README.RVF is modifed in 2003.
As for "Editor 2" demo, probably it stops loading on controls inserted in document. In order to load controls from RVF file, these controls must be registered.
Add in the "Editor 2" demo the following code (to the end of Unit1.pas, before the final "end."):
Are you sure that you saved README.RVF in the directory of this demo, not in another directory?
In your zip file, README.RVF is modifed in 2003.
As for "Editor 2" demo, probably it stops loading on controls inserted in document. In order to load controls from RVF file, these controls must be registered.
Add in the "Editor 2" demo the following code (to the end of Unit1.pas, before the final "end."):
Code: Select all
initialization
// We need to register classes in order to load them from rvf files
RegisterClasses([TButton, TEdit, TOleContainer]);
-
- Posts: 67
- Joined: Sat May 13, 2006 1:56 pm
- Location: Australia
Same Directory... still same problem
I notice when it compiles it takes an inordinately long time.
I will email the error messages for both Editor 1 and Editor after compiling under Delphi 2010. Called Editor 1.txt and Editor2.txt.
I tried adding a modified version of your code snippet to Editor2 Project....
initialization
// We need to register classes in order to load them from rvf files
RegisterClasses([TButton, TEdit]);
olecontainer was not declared and stopped it from working so I deleted it.
The problem which happens is that the load & import once I clicked it produces error message "Error during loading" and the truncated/ shortened file
stops always at this term "a2" where the 2 is supertext.
If I save to the same file name and replace it (readme.rvf), it prompts me to replace it and I click 'yes'. While the Editor is still open/on I then attempt to reopen the same readme.rvf file and I get the truncated version (but the saved addition I added before saving " This was edited 22032010" is still there) and the error message "Error during loading" again stopping at this term "a2" where the 2 is supertext.
If, however, I try closing Editor 1 and double clicking the readme.rvf file
the file opens normally showing the whole file contents, but the saved text I added before saving is no longer there.
It's as if the Load & Import button only loaded a temporary file.
This is strange behaviour.
I will email the error messages for both Editor 1 and Editor after compiling under Delphi 2010. Called Editor 1.txt and Editor2.txt.
I tried adding a modified version of your code snippet to Editor2 Project....
initialization
// We need to register classes in order to load them from rvf files
RegisterClasses([TButton, TEdit]);
olecontainer was not declared and stopped it from working so I deleted it.
The problem which happens is that the load & import once I clicked it produces error message "Error during loading" and the truncated/ shortened file
stops always at this term "a2" where the 2 is supertext.
If I save to the same file name and replace it (readme.rvf), it prompts me to replace it and I click 'yes'. While the Editor is still open/on I then attempt to reopen the same readme.rvf file and I get the truncated version (but the saved addition I added before saving " This was edited 22032010" is still there) and the error message "Error during loading" again stopping at this term "a2" where the 2 is supertext.
If, however, I try closing Editor 1 and double clicking the readme.rvf file
the file opens normally showing the whole file contents, but the saved text I added before saving is no longer there.
It's as if the Load & Import button only loaded a temporary file.
This is strange behaviour.