Page 1 of 1

FontBackColor

Posted: Wed May 27, 2009 12:04 pm
by jnap
Hi,

How can I use FontBackColor without using the TRVActions? I need to use a TAdvOfficeTextColorSelector from TMS Software but the Actions override the color selector with it's own and also the selected color never displays on the Button.

Can this be done without using the Actions?

Many thanks

jnap

Posted: Wed May 27, 2009 3:12 pm
by Sergey Tkachenko
1) See the demo in Demos\Delphi\Editors\Editor 2\
It shows how to apply editing commands, including font background color.

2) You can still use RichViewActions with your own color selector.
- choose the color using your selector,
- assign rvActionFontBackColor1.UserInterface := rvacNone;
- assign the chosen color to rvActionFontBackColor1.Color;
- call rvActionFontBackColor1.ExecuteTarget(RichViewEdit1).

Posted: Wed May 27, 2009 5:08 pm
by jnap
Hi,

Thank you very much, I have used method number (2) which works very well.

Thanks again.

jnap

Posted: Wed May 27, 2009 5:30 pm
by jnap
I try to do the same thing for selecting the Font Type but always the Font Dialog will be displayed.

How is it possible to do this without displaying the Font Dialog?

I have tried with:

procedure TMain.FontCmbSelectFontName(Sender: TObject; AName: string);
begin
// rvActionFonts1.UserInterface := rvacNone;
rvActionFonts1.Font.Name := AName;
rvActionFonts1.ExecuteTarget(rve);
end;

Many thanks

jnap

Posted: Wed May 27, 2009 6:06 pm
by Sergey Tkachenko
TrvActionFonts cannot work without dialog.
But TrvActionFontEx can.
Assign UserInterface property = False, add a list of properties to apply in ValidProperties property, change values of the corresponding properties.

Posted: Wed May 27, 2009 9:03 pm
by jnap
Hi,

Thank you very much this works perfectly well.

I have used:

Code: Select all

procedure TMain.FontCmbSelectFontName(Sender: TObject; AName: string);
begin
  rvActionFontEx1.UserInterface := False;
  rvActionFontEx1.ValidProperties := [rvfimFontName];
  rvActionFontEx1.Font.Name := AName;
  rvActionFontEx1.ExecuteTarget(rve);
end;
jnap

Posted: Thu May 28, 2009 3:21 pm
by Sergey Tkachenko
If you use this action not only with this combobox, but also assigned to menu item or toolbar button, restore rvActionFontEx1.UserInterface := True after calling ExecuteTarget.

Posted: Thu May 28, 2009 11:44 pm
by jnap
Hi,

Thank you very much Sergey for all your time and help.