is it possible cast a value to ScaleRichEdit.RichViewEdit.OnResize
and ScaleRichEdit.RichViewEdit.VScrollPos.
if so are there any examples on how to do this.
Thanks in advance.
ScaleRichEdit.RichViewEdit.OnResize
-
- Site Admin
- Posts: 17553
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
ScaleRichEdit.RichViewEdit.OnResize
I would like to implement external scrollbars, like in the demo for RichViewEdit.
thanks for your reply
thanks for your reply
Give me your Email, I will send you an example.
or (TMyScrollBar - this is new ScrollBar):
or (TMyScrollBar - this is new ScrollBar):
Code: Select all
unit MFReplaceScrollBar;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, SclRView;
type
TForm1 = class(TForm)
srve: TSRichViewEdit;
procedure NewScrollBarHScroll(Sender: TObject; ScrollCode: TScrollCode;
var ScrollPos: Integer);
procedure NewScrollBarVScroll(Sender: TObject; ScrollCode: TScrollCode;
var ScrollPos: Integer);
procedure SRVEScrollBarHChange(Sender: TObject);
procedure SRVEScrollBarVChange(Sender: TObject);
procedure srveChange(Sender: TObject);
procedure srveResize(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure SetNewScrollBar;
end;
var
Form1: TForm1;
implementation
uses MyScrollBar;
var
NewScrollBarH, NewScrollBarV : TMyScrollBar;
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
NewScrollBarH := TMyScrollBar.Create(Self);
NewScrollBarH.Name := 'NewScrollBarH';
NewScrollBarH.Parent := Self;
NewScrollBarH.Kind := sbHorizontal;
NewScrollBarH.OnScroll := NewScrollBarHScroll;
NewScrollBarV := TMyScrollBar.Create(Self);
NewScrollBarV.Name := 'NewScrollBarV';
NewScrollBarV.Parent := Self;
NewScrollBarV.Kind := sbVertical;
NewScrollBarV.OnScroll := NewScrollBarVScroll;
end;
procedure TForm1.SetNewScrollBar;
begin
srve.HScrollBar := False;
srve.VScrollBar := False;
srve.Update;
srveChange(nil);
srve.ScrollBarH.OnChange := SRVEScrollBarHChange;
srve.ScrollBarV.OnChange := SRVEScrollBarVChange;
srveResize(nil);
end;
procedure TForm1.FormResize(Sender: TObject);
begin
srve.Width := ClientWidth - srve.ScrollBarV.Width;
srve.Height := ClientHeight - srve.ScrollBarH.Height;
SetNewScrollBar;
end;
procedure TForm1.NewScrollBarHScroll(Sender: TObject;
ScrollCode: TScrollCode; var ScrollPos: Integer);
begin
srve.HScrollPos := ScrollPos;
end;
procedure TForm1.NewScrollBarVScroll(Sender: TObject;
ScrollCode: TScrollCode; var ScrollPos: Integer);
begin
srve.VScrollPos := ScrollPos;
end;
procedure TForm1.SRVEScrollBarHChange(Sender: TObject);
begin
NewScrollBarV.Position := srve.VScrollPos;
end;
procedure TForm1.SRVEScrollBarVChange(Sender: TObject);
begin
NewScrollBarV.Position := srve.VScrollPos;
end;
procedure TForm1.srveResize(Sender: TObject);
begin
NewScrollBarH.SetBounds(srve.Left, srve.Top + srve.Height,
srve.Width,
srve.ScrollBarH.Height);
NewScrollBarV.SetBounds(srve.Left + srve.Width, srve.Top,
srve.ScrollBarV.Width,
srve.Height);
end;
procedure TForm1.srveChange(Sender: TObject);
begin
NewScrollBarH.Max := srve.HMaxScrollPos;
NewScrollBarH.Position := srve.HScrollPos;
NewScrollBarH.Enabled := srve.HMaxScrollPos > 2;
NewScrollBarV.Max := srve.VMaxScrollPos;
NewScrollBarV.Position := srve.VScrollPos;
NewScrollBarV.Enabled := srve.VMaxScrollPos > 2;
end;
end.