fixed scrolling offset of TScrollingWinControl

git-svn-id: trunk@3818 -
This commit is contained in:
mattias 2003-01-18 21:31:43 +00:00
parent f764105c7e
commit b66832a1e7
4 changed files with 18 additions and 12 deletions

View File

@ -132,7 +132,6 @@ type
Protected Protected
procedure AlignControls(AControl: TControl; var ARect: TRect); override; procedure AlignControls(AControl: TControl; var ARect: TRect); override;
procedure CreateWnd; override; procedure CreateWnd; override;
function GetClientScrollOffset: TPoint; override;
Procedure WMEraseBkgnd(var Message: TLMEraseBkgnd); message LM_ERASEBKGND; Procedure WMEraseBkgnd(var Message: TLMEraseBkgnd); message LM_ERASEBKGND;
procedure WMPaint(var message: TLMPaint); message LM_PAINT; procedure WMPaint(var message: TLMPaint); message LM_PAINT;
procedure WMSize(var Message: TLMSize); message LM_Size; procedure WMSize(var Message: TLMSize); message LM_Size;
@ -162,6 +161,8 @@ type
{ TScrollBox } { TScrollBox }
TScrollBox = class(TScrollingWinControl) TScrollBox = class(TScrollingWinControl)
protected
function GetClientScrollOffset: TPoint; override;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
published published

View File

@ -405,7 +405,7 @@ Type
Type Type
//TCustomGrid=Class(TScrollBox) //TCustomGrid=Class(TScrollBox)
//TCustomGrid=Class(TCustomControl) //TCustomGrid=Class(TCustomControl)
TCustomGrid=Class(TScrollingWinControl) TCustomGrid = Class(TScrollingWinControl)
Private Private
FAutoAdvance: TAutoAdvance; FAutoAdvance: TAutoAdvance;
FDefaultDrawing: Boolean; FDefaultDrawing: Boolean;
@ -2362,7 +2362,7 @@ Var
R: TRect; R: TRect;
begin begin
inherited MouseDown(Button, Shift, X, Y); inherited MouseDown(Button, Shift, X, Y);
{$IfDef dbgFocus}WriteLn('MouseDown INIT');{$Endif} {$IfDef dbgFocus}WriteLn('TCustomGrid.MouseDown INIT ',Name,':',ClassName);{$Endif}
If Not FGCache.ValidGrid Then Exit; If Not FGCache.ValidGrid Then Exit;
If Not (ssLeft in Shift) Then Exit; If Not (ssLeft in Shift) Then Exit;
Gz:=MouseToGridZone(X,Y, False); Gz:=MouseToGridZone(X,Y, False);
@ -2416,7 +2416,7 @@ begin
End; End;
End; End;
End; End;
{$ifDef dbgFocus} WriteLn('MouseDown END'); {$Endif} {$ifDef dbgFocus} WriteLn('TCustomGrid.MouseDown END'); {$Endif}
end; end;
procedure TCustomGrid.MouseMove(Shift: TShiftState; X, Y: Integer); procedure TCustomGrid.MouseMove(Shift: TShiftState; X, Y: Integer);
@ -2452,7 +2452,7 @@ var
begin begin
inherited MouseUp(Button, Shift, X, Y); inherited MouseUp(Button, Shift, X, Y);
If Not FGCache.ValidGrid Then Exit; If Not FGCache.ValidGrid Then Exit;
{$IfDef dbgFocus}WriteLn('MouseUP INIT');{$Endif} {$IfDef dbgFocus}WriteLn('TCustomGrid.MouseUP INIT');{$Endif}
Cur:=MouseToCell(Point(x,y)); Cur:=MouseToCell(Point(x,y));
Case fGridState of Case fGridState of
gsSelecting: gsSelecting:
@ -2487,7 +2487,7 @@ begin
End; End;
End; End;
fGridState:=gsNormal; fGridState:=gsNormal;
{$IfDef dbgFocus}WriteLn('MouseUP END RND=',Random);{$Endif} {$IfDef dbgFocus}WriteLn('TCustomGrid.MouseUP END RND=',Random);{$Endif}
end; end;
procedure TCustomGrid.DblClick; procedure TCustomGrid.DblClick;

View File

@ -1,3 +1,5 @@
// included by forms.pp
{ {
***************************************************************************** *****************************************************************************
* * * *
@ -13,8 +15,17 @@
***************************************************************************** *****************************************************************************
} }
function TScrollBox.GetClientScrollOffset: TPoint;
begin
Result.X:=HorzScrollBar.Position;
Result.Y:=VertScrollBar.Position;
end;
constructor TScrollBox.Create(AOwner: TComponent); constructor TScrollBox.Create(AOwner: TComponent);
begin begin
Inherited Create(AOwner); Inherited Create(AOwner);
fCompStyle:= csScrollBox; fCompStyle:= csScrollBox;
end; end;
// included by forms.pp

View File

@ -336,12 +336,6 @@ begin
UpdateScrollBars; UpdateScrollBars;
end; end;
function TScrollingWinControl.GetClientScrollOffset: TPoint;
begin
Result.X:=HorzScrollBar.Position;
Result.Y:=VertScrollBar.Position;
end;
procedure TScrollingWinControl.AlignControls(AControl: TControl; var ARect: TRect); procedure TScrollingWinControl.AlignControls(AControl: TControl; var ARect: TRect);
begin begin
HorzScrollBar.AutoCalcRange; HorzScrollBar.AutoCalcRange;