Merged revision(s) 59865-59866 #e676482f09-#e676482f09 from trunk:

LCL: TWinControl: Fixed TGraphicControl.Cursor not working properly with TScrollBox. Issue #34714
........
LCL: Missed removing of capfHasScrollOffset in LCL. Needed for revision 59865 #e676482f09.
........

git-svn-id: branches/fixes_2_0@59869 -
This commit is contained in:
maxim 2018-12-19 22:30:48 +00:00
parent 98a3881d47
commit 67008a7ffa
4 changed files with 5 additions and 19 deletions

View File

@ -3226,7 +3226,7 @@ begin
begin // runtime - handle multi clicks according to ControlStyle
if LastMouse.ClickCount > 1 then
begin
TargetControl := AWinControl.ControlAtPos(AWinControl.ScreenToClient(AMousePos), [capfHasScrollOffset]);
TargetControl := AWinControl.ControlAtPos(AWinControl.ScreenToClient(AMousePos), []);
if TargetControl=nil then
TargetControl := AWinControl;
case LastMouse.ClickCount of
@ -3394,8 +3394,7 @@ begin
begin
Result := WinControl;
Control := WinControl.ControlAtPos(WinControl.ScreenToClient(Position),
[capfAllowWinControls, capfRecursive,
capfHasScrollOffset] + DisabledFlag[AllowDisabled]);
[capfAllowWinControls, capfRecursive] + DisabledFlag[AllowDisabled]);
//debugln(['FindControlAtPosition ',dbgs(Position),' ',DbgSName(WinControl),' ',dbgs(WinControl.ScreenToClient(Position)),' ',DbgSName(Control)]);
if Assigned(Control) then
Result := Control;

View File

@ -182,7 +182,6 @@ type
public
constructor Create(TheOwner : TComponent); override;
destructor Destroy; override;
function ControlAtPos(const Pos: TPoint; Flags: TControlAtPosFlags): TControl; override;
function ScreenToClient(const APoint: TPoint): TPoint; override;
function ClientToScreen(const APoint: TPoint): TPoint; override;
procedure UpdateScrollbars;

View File

@ -316,12 +316,6 @@ begin
inherited Destroy;
end;
function TScrollingWinControl.ControlAtPos(const Pos: TPoint;
Flags: TControlAtPosFlags): TControl;
begin
Result := inherited ControlAtPos(Pos, Flags - [capfHasScrollOffset]);
end;
function TScrollingWinControl.ScreenToClient(const APoint: TPoint): TPoint;
var
P: TPoint;

View File

@ -5151,21 +5151,15 @@ var
function GetControlAtPos(AControl: TControl): Boolean;
var
ControlPos: TPoint;
ControlClientBounds: TRect;
begin
with AControl do
begin
// MG: Delphi checks for PtInRect(ClientRect,P). But the client area is
// not always at 0,0, so I guess this is a bug in the VCL.
ControlPos := Point(P.X - Left, P.Y - Top);
Result := (ControlPos.X >= 0) and (ControlPos.Y >= 0) and
(ControlPos.X < Width) and (ControlPos.Y < Height);
if Result and (capfOnlyClientAreas in Flags) then
begin
ControlClientBounds := GetChildrenRect(false);
Result:=PtInRect(ControlClientBounds, ControlPos);
end;
Result := PtInRect(ClientRect, ControlPos);
Result := Result
and (
@ -8424,7 +8418,7 @@ begin
begin
// don't allow disabled and don't search wincontrols - they receive their
// message themself
Child := ControlAtPos(ScreenToClient(SmallPointToPoint(Message.Pos)), [capfHasScrollOffset]);
Child := ControlAtPos(ScreenToClient(SmallPointToPoint(Message.Pos)), []);
if Assigned(Child) then
with Message do
begin