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

View File

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

View File

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