trichview.com

trichview.support




Re: More than one control panel


Return to index


Author

Message

Sergey Tkachenko

Posted: 10/23/2003 17:23:40


If you use the code from the ActionTestDemo, values in the comboboxes are

changed in RichViewEdit1.OnCurTextStyleChanged:


// Current font is changed. Updating the combo-boxes.

procedure TForm3.RichViewEdit1CurTextStyleChanged(Sender: TObject);

var CurStyle: TFontInfo;

begin

  UpdatingCombos := True;

  try

    CurStyle := RVStyle1.TextStyles[RichViewEdit1.CurTextStyleNo];

    cmbFont.Text := CurStyle.FontName;

    cmbFont.OnClick(Sender);

    cmbFontSize.Text := IntToStr(CurStyle.Size);

  finally

    UpdatingCombos := False;

  end;

end;


You just need to call this procedure when it's needed.


> Here's my problem.  I have a TRichViewEdit and ControlPanel on a form.  If

I

> remove the rvedit as the default control of the controlpanel, when I do a

> rvActionNew.Execute, the font and font size combo don't get default

values.

> What makes the font and fontsize combos get their default values?

>

> "Sergey Tkachenko" <[email protected]> wrote in message

> news:[email protected]...

> > > Do I have to change the ControlPanel.DefaultControl property each time

I

> > > want to work with the other richview?

> >

> > Yes. Or you can just not assign this property, actions will work with

the

> > focused control.

> > Or you can assign Control property for the specific actions.

> >

> > I've found that before I load my

> > > richviewedit, I have to call rvActionNew.Execute for the font and

> fontsize

> > > combos to have default values.  Is this appropriate?

> >

> > Yes

> >

> >

>

>





Powered by ABC Amber Outlook Express Converter