trichview.com

trichview.support




Re: Ctrl+B etc


Return to index


Author

Message

Sergey Tkachenko

Posted: 11/28/2003 18:40:22


Look how TEXT_BOLD is processed in TForm1.rveStyleConversion:


      TEXT_BOLD:

        if btnBold.Down then

          FontInfo.Style := FontInfo.Style+[fsBold]

        else

          FontInfo.Style := FontInfo.Style-[fsBold];


As you can see, it's state depends on btnBold.Down state.

If you want to work with action, you need to process action.OnUpdate:


procedure TForm1.actBoldUpdate(Sender: TObject);

begin

  actBold.Enabled := True;

  actBold.Checked := fsBold in

rve.Style.TextStyles[rve.CurTextStyleNo].Style;

end;


and change rveStyleConversion:


      TEXT_BOLD:

        if not actBold.Checked then

          FontInfo.Style := FontInfo.Style+[fsBold]

        else

          FontInfo.Style := FontInfo.Style-[fsBold];



All this and many more is already implemened in RichViewActions:

http://www.trichview.com/resources/actions



>

> In the editor2 of ur demo example i drop  tactionlist and add a action and

> assign ctrl+B as short cut and call the

rve.ApplyStyleConversion(TEXT_BOLD);

> but it doesnt make it bold





Powered by ABC Amber Outlook Express Converter