cocoa: resolve the issue with mouse events not processed by TabControl

git-svn-id: trunk@58645 -
This commit is contained in:
dmitry 2018-07-28 17:11:20 +00:00
parent 0e60e21aa7
commit 71fdf9349f
2 changed files with 13 additions and 4 deletions

View File

@ -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;

View File

@ -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