Page 1 of 1
DBSRichViewEdit Question(s)
Posted: Wed Apr 08, 2009 1:39 am
by CStevenson
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....)
Posted: Wed Apr 08, 2009 7:05 pm
by Sergey Tkachenko
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)
Posted: Thu Apr 09, 2009 2:13 am
by CStevenson
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)
Thank you. I'll try that. Are there plans to implement text wrap around? If not, I'd like to request this feature.
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,
Posted: Thu Apr 09, 2009 7:44 am
by Sergey Tkachenko
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.
Posted: Thu Apr 09, 2009 1:21 pm
by CStevenson
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.
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?)
Posted: Thu Apr 09, 2009 9:26 pm
by CStevenson
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)
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.)
Posted: Fri Apr 10, 2009 1:19 am
by CStevenson
I've gotten the following error twice now with DBSRichViewEdit: "A call to an OS function has failed." Any idea what is causing this?
Posted: Fri Apr 10, 2009 5:42 am
by Sergey Tkachenko
Sorry, such problem was never reported. If you can reproduce it in a simple project, please send it to me.
Posted: Fri Apr 10, 2009 11:15 am
by CStevenson
Sergey,
I had two other questions earlier in this thread that you didn't answer. Would you look back at them, please?
Posted: Fri Apr 10, 2009 5:13 pm
by Sergey Tkachenko
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 )
Posted: Fri Apr 10, 2009 5:29 pm
by Sergey Tkachenko
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:
Code: Select all
rve.TopLevelEditor.BeginUndoGroup(rvutInsert);
rve.TopLevelEditor.SetUndoGroupMode(True);
if rve.InsertPicture(...) then
rve.SetCurrentItemExtraStrProperty(rvespImageFileName, FileName, true);
rve.TopLevelEditor.SetUndoGroupMode(False);
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.