change the background color and save it in my doc

General TRichView support forum. Please post your questions here
Post Reply
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

change the background color and save it in my doc

Post by alexandreq »

Hello,

I use DBSRichViewEdit and when I run the rvActionColor1.Execute, it changes the color of my baground doc. It is ok so far.

But when the color is changed it doesn't trigger the state table to dsedit and even if I have my table in dsEdit and save it when the background is changed, it doesn't save it in my table. Why?

thanks
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

I forgot to comment:

Both RVFOptions.rvfoSaveBack and RVFOptions.rvfoLoadBack are true
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

This is a problem in TrvActionColor.
Open RichViewActions.pas, change TrvActionColor.ExecuteCommand to:

Code: Select all

procedure TrvActionColor.ExecuteCommand(rve: TCustomRichViewEdit;
  Command: Integer);
begin
  if not (rvfoSaveBack in rve.RVFOptions) or rve.CanChange then begin
    rve.Color := Color;
    if rvfoSaveBack in rve.RVFOptions then
      rve.Change;
    RVA_Events.DoOnBackgroundChange(Self, rve);
  end;
end;
This change will be included in the next update of RichViewActions.
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

perfect!!!!

Thanks very much
Post Reply