Page 1 of 1

change the background color and save it in my doc

Posted: Thu Feb 09, 2012 11:59 am
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

Posted: Thu Feb 09, 2012 5:58 pm
by alexandreq
I forgot to comment:

Both RVFOptions.rvfoSaveBack and RVFOptions.rvfoLoadBack are true

Posted: Thu Feb 09, 2012 7:56 pm
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.

Posted: Fri Feb 10, 2012 10:00 am
by alexandreq
perfect!!!!

Thanks very much