Hi Sergey,
This is probably real simple but I can NOT figure out how to save and load an rvf file with background color intact using a regular rve. How do you do it? I have the rve.style.color set, I've tried enabling rvfoSaveBack and rvfoLoadBack, but no matter what I do, when I open the file I save from my app in your RichViewActionsTest demo, the background is white (should be a dark gray). Individual paragraphs or text retain their back colors (if I set them) but never the whole document color. I want the whole doc background color to be saved and loaded. Your demo app does exactly what I want when I click the Format|Background Color menu. I'm not using actions so I need to know how to do this manually.
Also, I have my source rve.VAlign set to tlCenter, and I want that saved and loaded when I open the file in another rve editor as well. I have not figured out how to do that either.
Thanks Sergey
Stan
Document Background Color
Re: Document Background Color
Hi Sergey,
OK, this seemed to work when saving my file:
This worked too:
I'd guess the 2nd way is the one to use.
This also helped with scooting things down some in the saved file:
But I would still like to get the document's vertical alignment set to center when the file is saved, so if you can tell me about that I would appreciate it. This rve always has just 1 image and a few lines of text below that image. Text and image are all aligned center horizontally and vertically, and I'd like to be able to save the file that way.
Stan
OK, this seemed to work when saving my file:
Code: Select all
TCustomRichView(coverRVE).Color := CoverRVEStyle.Color;
Code: Select all
coverRVE.SetIntProperty( rvipColor , CoverRVEStyle.Color );
This also helped with scooting things down some in the saved file:
Code: Select all
coverRVE.SetIntProperty( rvipTopMargin , 150 );
Stan
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Document Background Color
rv.Style.Color is not saved in RVF, only rv.Color
(rv.Style.Color is used only if rv.Color = clNone).
Assigning the property directly or via SetIntProperty, it does not matter, so SetIntProperty does not add any new functionality.
(a useful method is SetIntPropertyEd that allows assigning properties as an undoable operation).
Currently, VAlign is not saved in RVF.
You can store additional information in RVF using DocProperties or DocObjects property.
(rv.Style.Color is used only if rv.Color = clNone).
Assigning the property directly or via SetIntProperty, it does not matter, so SetIntProperty does not add any new functionality.
(a useful method is SetIntPropertyEd that allows assigning properties as an undoable operation).
Currently, VAlign is not saved in RVF.
You can store additional information in RVF using DocProperties or DocObjects property.
Re: Document Background Color
Thanks Sergey, that's good enough and lets me know what I need to continue.
Stan
Stan
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Document Background Color
If you want to store VAlign in RVF, include rvfoSaveDocProperties and rvfoLoadDocProperties in RVFOptions.
Before saving, call
After loading, call
Before saving, call
Code: Select all
rv.DocProperties.Values['VAlign'] := IntToStr(ord(rv.VAlign));
Code: Select all
rv.VAlign := TTextLayout(StrToIntDef(rv.DocProperties.Values['VAlign'], 0));
Re: Document Background Color
Thanks Sergey
Stan
Stan