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_) and isMouseMoveEvent(Result.type_)
then begin then begin
cb := TrackedControl.lclGetCallback; cb := TrackedControl.lclGetCallback;
if Assigned(cb) then if Assigned(cb) then cb.MouseMove(Result);
// making sure that the only the same control is called
cb.MouseMove(Result, true);
end; end;
end; end;

View File

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

View File

@ -73,7 +73,7 @@ type
procedure KeyEvAfter; procedure KeyEvAfter;
procedure MouseClick; virtual; procedure MouseClick; virtual;
function MouseMove(Event: NSEvent; AForceObject: Boolean): Boolean; virtual; function MouseMove(Event: NSEvent): Boolean; virtual;
function scrollWheel(Event: NSEvent): Boolean; virtual; function scrollWheel(Event: NSEvent): Boolean; virtual;
procedure frameDidChange(sender: id); virtual; procedure frameDidChange(sender: id); virtual;
procedure boundsDidChange(sender: id); virtual; procedure boundsDidChange(sender: id); virtual;
@ -1231,7 +1231,7 @@ begin
end; end;
end; end;
function TLCLCommonCallback.MouseMove(Event: NSEvent; AForceObject: Boolean): Boolean; function TLCLCommonCallback.MouseMove(Event: NSEvent): Boolean;
var var
Msg: TLMMouseMove; Msg: TLMMouseMove;
MousePos: NSPoint; MousePos: NSPoint;
@ -1243,6 +1243,7 @@ var
targetControl: TWinControl; targetControl: TWinControl;
childControl:TWinControl; childControl:TWinControl;
bndPt, clPt: TPoint; bndPt, clPt: TPoint;
MouseTargetLookup: Boolean;
begin begin
if Assigned(Owner) and not Owner.lclIsEnabled then if Assigned(Owner) and not Owner.lclIsEnabled then
begin begin
@ -1258,7 +1259,10 @@ begin
MousePos := Event.locationInWindow; MousePos := Event.locationInWindow;
OffsetMousePos(MousePos, bndPt, clPt); 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 begin
rect:=Owner.lclClientFrame; rect:=Owner.lclClientFrame;
targetControl:=nil; targetControl:=nil;