FontBackColor

General TRichView support forum. Please post your questions here
Post Reply
jnap
Posts: 31
Joined: Sat Sep 30, 2006 6:23 pm

FontBackColor

Post 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
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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).
jnap
Posts: 31
Joined: Sat Sep 30, 2006 6:23 pm

Post by jnap »

Hi,

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

Thanks again.

jnap
jnap
Posts: 31
Joined: Sat Sep 30, 2006 6:23 pm

Post 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
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
jnap
Posts: 31
Joined: Sat Sep 30, 2006 6:23 pm

Post 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
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
jnap
Posts: 31
Joined: Sat Sep 30, 2006 6:23 pm

Post by jnap »

Hi,

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