cocoa: remove AForceObject and determine the flag value based on the mouse event type

git-svn-id: trunk@58850 -
This commit is contained in:
dmitry 2018-09-04 03:25:06 +00:00
parent 80d14feaba
commit 7ad949d64d
3 changed files with 9 additions and 7 deletions

View File

@ -389,9 +389,7 @@ begin
and isMouseMoveEvent(Result.type_)
then begin
cb := TrackedControl.lclGetCallback;
if Assigned(cb) then
// making sure that the only the same control is called
cb.MouseMove(Result, true);
if Assigned(cb) then cb.MouseMove(Result);
end;
end;

View File

@ -49,7 +49,7 @@ type
// mouse events
function MouseUpDownEvent(Event: NSEvent; AForceAsMouseUp: Boolean = False; AOverrideBlock: Boolean = False): Boolean;
procedure MouseClick;
function MouseMove(Event: NSEvent; AForceObject: Boolean = False): Boolean;
function MouseMove(Event: NSEvent): Boolean;
function KeyEvent(Event: NSEvent; AForceAsKeyDown: Boolean = False): Boolean;
procedure KeyEvPrepare(Event: NSEvent; AForceAsKeyDown: Boolean = False);

View File

@ -73,7 +73,7 @@ type
procedure KeyEvAfter;
procedure MouseClick; virtual;
function MouseMove(Event: NSEvent; AForceObject: Boolean): Boolean; virtual;
function MouseMove(Event: NSEvent): Boolean; virtual;
function scrollWheel(Event: NSEvent): Boolean; virtual;
procedure frameDidChange(sender: id); virtual;
procedure boundsDidChange(sender: id); virtual;
@ -1231,7 +1231,7 @@ begin
end;
end;
function TLCLCommonCallback.MouseMove(Event: NSEvent; AForceObject: Boolean): Boolean;
function TLCLCommonCallback.MouseMove(Event: NSEvent): Boolean;
var
Msg: TLMMouseMove;
MousePos: NSPoint;
@ -1243,6 +1243,7 @@ var
targetControl: TWinControl;
childControl:TWinControl;
bndPt, clPt: TPoint;
MouseTargetLookup: Boolean;
begin
if Assigned(Owner) and not Owner.lclIsEnabled then
begin
@ -1258,7 +1259,10 @@ begin
MousePos := Event.locationInWindow;
OffsetMousePos(MousePos, bndPt, clPt);
if not AForceObject then
// For "dragged" events, the same "Target" should be used
MouseTargetLookup := Event.type_ = NSMouseMoved;
if MouseTargetLookup then
begin
rect:=Owner.lclClientFrame;
targetControl:=nil;