From 71fdf9349fc453ef1d77644de094396e22abdce6 Mon Sep 17 00:00:00 2001 From: dmitry Date: Sat, 28 Jul 2018 17:11:20 +0000 Subject: [PATCH] cocoa: resolve the issue with mouse events not processed by TabControl git-svn-id: trunk@58645 - --- lcl/interfaces/cocoa/cocoatabcontrols.pas | 16 ++++++++++++---- lcl/interfaces/cocoa/cocoawscomctrls.pas | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lcl/interfaces/cocoa/cocoatabcontrols.pas b/lcl/interfaces/cocoa/cocoatabcontrols.pas index 9e7b7a0f8e..d831257eee 100644 --- a/lcl/interfaces/cocoa/cocoatabcontrols.pas +++ b/lcl/interfaces/cocoa/cocoatabcontrols.pas @@ -471,16 +471,24 @@ begin end; procedure TCocoaTabControl.mouseDown(event: NSEvent); +var + res : Boolean; begin - if not Assigned(callback) then callback.MouseUpDownEvent(event); - // do not block? - inherited mouseDown(event); + res := callback.MouseUpDownEvent(event, false, true); + if not Assigned(callback) or not res then + begin + inherited mouseDown(event); + + if Assigned(callback) then + begin + callback.MouseUpDownEvent(event, True); + end; + end end; procedure TCocoaTabControl.mouseUp(event: NSEvent); begin if not Assigned(callback) then callback.MouseUpDownEvent(event); - // do not block? inherited mouseUp(event); end; diff --git a/lcl/interfaces/cocoa/cocoawscomctrls.pas b/lcl/interfaces/cocoa/cocoawscomctrls.pas index 44b758fbb4..14c128fcda 100644 --- a/lcl/interfaces/cocoa/cocoawscomctrls.pas +++ b/lcl/interfaces/cocoa/cocoawscomctrls.pas @@ -507,6 +507,7 @@ begin lControl := TCocoaTabControl.alloc.lclInitWithCreateParams(AParams); lTabStyle := LCLTabPosToNSTabStyle(lTabControl.ShowTabs, lTabControl.BorderWidth, lTabControl.TabPosition); lControl.setTabViewType(lTabStyle); + lControl.lclEnabled := AWinControl.Enabled; Result := TLCLIntfHandle(lControl); if Result <> 0 then begin