DBSRichViewEdit Question(s)
-
- Posts: 8
- Joined: Sun Apr 05, 2009 12:40 am
DBSRichViewEdit Question(s)
Is it possible to put a picture placeholder in a RichView document, and then automatically load the picture from a database when the document is viewed? (Ideally, this would ONLY load the picture when it was within the current screen, dynamically loading the pictures as needed.) The goal is to keep the document size extremely small by using the placeholders mentioned above, but still have access to the pictures when needed.
Also, how do I get the text to wrap around a picture? (Like MS Word does....)
Also, how do I get the text to wrap around a picture? (Like MS Word does....)
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 8
- Joined: Sun Apr 05, 2009 12:40 am
Thank you. I'll try that. Are there plans to implement text wrap around? If not, I'd like to request this feature.Sergey Tkachenko wrote:You can exclude rvfoSavePicturesBody from RichView.RVFOptions, and use RichView.OnRVFPictureNeeded event to load pictures.
Text wrap around pictures is not implemented yet. Currently I am working on left and right alignment of pictures (like in HTML)
How do I get the spiral notebook look, like is in the ActionTest demo? I have tried copying it from the document, and pasting it into a DBSRichViewEdit, but I don't get the spiral notebook.
Thanks,
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Left/right alignment of picture means text wrapping around to the right/left of the picture. Text at both left and right sides of picture is not planned for near future.
The notebook effect is implemented using tiled background picture. Background is not copied to the clipboard. You can see this picture in Format | Background menu.
The notebook effect is implemented using tiled background picture. Background is not copied to the clipboard. You can see this picture in Format | Background menu.
-
- Posts: 8
- Joined: Sun Apr 05, 2009 12:40 am
I'm trying to get the notebook background to save in a DBSRichViewEdit, but it doesn't seem to save. Is there something special I need to do? (Or would I have to save that separately?)Sergey Tkachenko wrote:Left/right alignment of picture means text wrapping around to the right/left of the picture. Text at both left and right sides of picture is not planned for near future.
The notebook effect is implemented using tiled background picture. Background is not copied to the clipboard. You can see this picture in Format | Background menu.
-
- Posts: 8
- Joined: Sun Apr 05, 2009 12:40 am
I see where (and how) to process the picture loading from RichView.OnRVFPictureNeeded event. However, I am not clear on how to embed the name in the document prior to saving. Do you have some example code of how to do this? (I see the sample code in the helpfile for the OnRVFPictureNeeded event, but I need the other side.)Sergey Tkachenko wrote:You can exclude rvfoSavePicturesBody from RichView.RVFOptions, and use RichView.OnRVFPictureNeeded event to load pictures.
Text wrap around pictures is not implemented yet. Currently I am working on left and right alignment of pictures (like in HTML)
-
- Posts: 8
- Joined: Sun Apr 05, 2009 12:40 am
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 8
- Joined: Sun Apr 05, 2009 12:40 am
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
For saving and loading background, include rvfoSaveBack and rvfoLoadBack in RVFOptions property.
Assigning BackgroundStyle and BackgroundBitmap properties is not an editing operations, so you need to write some additional code to store them in db (CanChange before assigning, Change after, see http://www.trichview.com/help/idh_examp ... edit1.html )
Assigning BackgroundStyle and BackgroundBitmap properties is not an editing operations, so you need to write some additional code to store them in db (CanChange before assigning, Change after, see http://www.trichview.com/help/idh_examp ... edit1.html )
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
You can store file name either in item text (the first parameter of InsertPicture) or in rvespImageFileName item property. The latter is recommended.
If you insert pictures yourself, use this code:
But images may appear in the document in a different way, for example when you paste them or insert RTF file.
I suggest, before saving document, to enumerate all pictures and assign FileName to them.
See the demo in Demos\Delphi\Assorted\Graphics\SharedImages\. This demo stores all pictures in a special subfolder. Before saving, it calls SaveAllUnknownImages procedure which assigns names to all pictures with undefined names and saves them to this subfolder.
If you insert pictures yourself, use this code:
Code: Select all
rve.TopLevelEditor.BeginUndoGroup(rvutInsert);
rve.TopLevelEditor.SetUndoGroupMode(True);
if rve.InsertPicture(...) then
rve.SetCurrentItemExtraStrProperty(rvespImageFileName, FileName, true);
rve.TopLevelEditor.SetUndoGroupMode(False);
I suggest, before saving document, to enumerate all pictures and assign FileName to them.
See the demo in Demos\Delphi\Assorted\Graphics\SharedImages\. This demo stores all pictures in a special subfolder. Before saving, it calls SaveAllUnknownImages procedure which assigns names to all pictures with undefined names and saves them to this subfolder.