mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 09:38:12 +02:00
fixed scrolling offset of TScrollingWinControl
git-svn-id: trunk@3818 -
This commit is contained in:
parent
f764105c7e
commit
b66832a1e7
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user