trichview.com

trichview.support




Re: scrollbars


Return to index


Author

Message

Yernar

Posted: 02/01/2003 12:37:47


procedure TForm.RichViewHScrolled(Sender: TObject);

begin

  HorizScrollBar.Position := RichView.HScrollPos;

end;


procedure TForm.RichViewVScrolled(Sender: TObject);

begin

  VertScrollBar.Position := RichView.VScrollPos;

end;


procedure TForm.RichViewResize(Sender: TObject);

begin

  ScrollAdjust(RichView, HorizScrollBar, VertScrollBar);

end;


procedure TForm.HorizScrollBarChange(Sender: TObject);

begin

  RichView.HScrollPos := HorizScrollBar.Position;

end;


procedure TForm.VertScrollBarChange(Sender: TObject);

begin

  RichView.VScrollPos := VertScrollBar.Position;

end;


procedure TForm.ScrollAdjust(MyRichView: TCustomRichView; HorizSB,

  VertSB: TMyScrollBar);

begin

  if MyRichView.VScrollMax > 0 then

    VertSB.Max := MyRichView.VScrollMax

  else

  begin

    VertSB.Max := 0;

    VertSB.PageSize := 0;

  end;

  VertSB.Position := MyRichView.VScrollPos;

  VertSB.Visible := VertSB.Max > 0;

  if MyRichView.HScrollMax > 0 then

    HorizSB.Max := MyRichView.HScrollMax

  else

  begin

    HorizSB.Max := 0;

    HorizSB.PageSize := 0;

  end;

  HorizSB.Position := MyRichView.HScrollPos;

  HorizSB.Visible := HorizSB.Max > 0;

end;





Powered by ABC Amber Outlook Express Converter