mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 22:19:12 +02:00
cocoa: get rid of cocoa mouse events supression. fix #33177
git-svn-id: trunk@58540 -
This commit is contained in:
parent
acedd9f432
commit
fefbc9e7cc
@ -116,15 +116,6 @@ type
|
|||||||
class procedure Invalidate(const AWinControl: TWinControl); override;
|
class procedure Invalidate(const AWinControl: TWinControl); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TLCLCustomControlCallback }
|
|
||||||
|
|
||||||
TLCLCustomControlCallback = class(TLCLCommonCallback)
|
|
||||||
public
|
|
||||||
function MouseMove(Event: NSEvent): Boolean; override;
|
|
||||||
function MouseUpDownEvent(Event: NSEvent; AForceAsMouseUp: Boolean = False): Boolean; override;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TCocoaWSCustomControl }
|
{ TCocoaWSCustomControl }
|
||||||
|
|
||||||
TCocoaWSCustomControl = class(TWSCustomControl)
|
TCocoaWSCustomControl = class(TWSCustomControl)
|
||||||
@ -187,21 +178,6 @@ begin
|
|||||||
SetViewDefaults(Result);
|
SetViewDefaults(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TLCLCustomControlCallback }
|
|
||||||
|
|
||||||
function TLCLCustomControlCallback.MouseMove(Event: NSEvent): Boolean;
|
|
||||||
begin
|
|
||||||
inherited MouseMove(Event);
|
|
||||||
Result:=True;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TLCLCustomControlCallback.MouseUpDownEvent(Event: NSEvent; AForceAsMouseUp: Boolean = False): Boolean;
|
|
||||||
begin
|
|
||||||
inherited MouseUpDownEvent(Event, AForceAsMouseUp);
|
|
||||||
Result := True;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TLCLCommonCallback }
|
{ TLCLCommonCallback }
|
||||||
|
|
||||||
function TLCLCommonCallback.GetHasCaret: Boolean;
|
function TLCLCommonCallback.GetHasCaret: Boolean;
|
||||||
@ -1693,10 +1669,10 @@ class function TCocoaWSCustomControl.CreateHandle(const AWinControl: TWinControl
|
|||||||
var
|
var
|
||||||
ctrl : TCocoaCustomControl;
|
ctrl : TCocoaCustomControl;
|
||||||
sl : TCocoaManualScrollView;
|
sl : TCocoaManualScrollView;
|
||||||
lcl : TLCLCustomControlCallback;
|
lcl : TLCLCommonCallback;
|
||||||
begin
|
begin
|
||||||
ctrl := TCocoaCustomControl(TCocoaCustomControl.alloc.lclInitWithCreateParams(AParams));
|
ctrl := TCocoaCustomControl(TCocoaCustomControl.alloc.lclInitWithCreateParams(AParams));
|
||||||
lcl := TLCLCustomControlCallback.Create(ctrl, AWinControl);
|
lcl := TLCLCommonCallback.Create(ctrl, AWinControl);
|
||||||
ctrl.callback := lcl;
|
ctrl.callback := lcl;
|
||||||
|
|
||||||
sl := EmbedInManualScrollView(ctrl);
|
sl := EmbedInManualScrollView(ctrl);
|
||||||
|
@ -368,7 +368,7 @@ class function TCocoaWSScrollingWinControl.CreateHandle(const AWinControl: TWin
|
|||||||
var
|
var
|
||||||
scrollcon: TCocoaScrollView;
|
scrollcon: TCocoaScrollView;
|
||||||
docview: TCocoaCustomControl;
|
docview: TCocoaCustomControl;
|
||||||
lcl: TLCLCustomControlCallback;
|
lcl : TLCLCommonCallback;
|
||||||
begin
|
begin
|
||||||
docview := TCocoaCustomControl.alloc.lclInitWithCreateParams(AParams);
|
docview := TCocoaCustomControl.alloc.lclInitWithCreateParams(AParams);
|
||||||
scrollcon:=EmbedInScrollView(docView);
|
scrollcon:=EmbedInScrollView(docView);
|
||||||
@ -378,7 +378,7 @@ begin
|
|||||||
scrollcon.setHasVerticalScroller(True);
|
scrollcon.setHasVerticalScroller(True);
|
||||||
scrollcon.isCustomRange := true;
|
scrollcon.isCustomRange := true;
|
||||||
|
|
||||||
lcl := TLCLCustomControlCallback.Create(docview, AWinControl);
|
lcl := TLCLCommonCallback.Create(docview, AWinControl);
|
||||||
docview.callback := lcl;
|
docview.callback := lcl;
|
||||||
docview.setAutoresizingMask(NSViewWidthSizable or NSViewHeightSizable);
|
docview.setAutoresizingMask(NSViewWidthSizable or NSViewHeightSizable);
|
||||||
scrollcon.callback := lcl;
|
scrollcon.callback := lcl;
|
||||||
@ -548,7 +548,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
cnt.callback := TLCLCustomControlCallback.Create(cnt, AWinControl);
|
cnt.callback := TLCLCommonCallback.Create(cnt, AWinControl);
|
||||||
if AParams.WndParent <> 0 then
|
if AParams.WndParent <> 0 then
|
||||||
begin
|
begin
|
||||||
lDestView := GetNSObjectView(NSObject(AParams.WndParent));
|
lDestView := GetNSObjectView(NSObject(AParams.WndParent));
|
||||||
|
Loading…
Reference in New Issue
Block a user