Background color

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
Extorian
Posts: 24
Joined: Wed Dec 28, 2011 3:52 pm

Background color

Post by Extorian »

Hello,

When in Draft mode or Web Mode in SRichViewEdit, is there are a way to change the background color fully to a darker color (like in Darkroom and other editors) and switch to white page color when in Layout mode?

I would really appreciate any help you can offer in this regard.

Thank you and kind regards

Extorian
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

TSRichViewEdit has a special property for changing page background color: SRichViewEdit.BackgroundProperty.GlobalPageBackgroundColor.
It overrides SRichViewEdit.RichViewEdit.Color and, unlike this property, is not saved to RVF.

I made a test in the ActionTest demo (not a tabbed, but with a single editor): in dmActionSRV.pas, I processed ActionList1.OnExecute:

Code: Select all

procedure TsrvActionsResource.ActionList1Execute(Action: TBasicAction;
  var Handled: Boolean);
begin
  if Action=srvActionLayoutWeb1 then
    Form3.SRichViewEdit1.BackgroundProperty.GlobalPageBackgroundColor := clYellow
  else if (Action=srvActionLayoutDraft1) or (Action=srvActionLayoutPrint1) then
    Form3.SRichViewEdit1.BackgroundProperty.GlobalPageBackgroundColor := clWhite;
end;
It works as expected (if you test it with the default readme.rvf, do not forget to remove a background image).
Extorian
Posts: 24
Joined: Wed Dec 28, 2011 3:52 pm

Post by Extorian »

Hi Sergey,

Thank you for the reply.

The code works fine but in web mode only a 1 inch band at the top is converted to yellow instead of the full white area being yellow.

Is it possible to have the full white area in a different color in web mode?

Thanks and kind regards,

Extorian
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I am afraid this color is hard-coded.
It will be fixed in the next update - a page color will be used.
Extorian
Posts: 24
Joined: Wed Dec 28, 2011 3:52 pm

Post by Extorian »

Thanks Sergey,

I look forward to it.

Thanks and kind regards,

Extorian
Post Reply