cocoa: adding support for removal tabs by freeing handle. Patch by David Jenkins. #35171

git-svn-id: trunk@61008 -
This commit is contained in:
dmitry 2019-04-18 03:47:21 +00:00
parent c3c3dea2a2
commit ff9256aff6

View File

@ -63,6 +63,7 @@ type
class function GetCocoaTabPageFromHandle(AHandle: HWND): TCocoaTabPage;
published
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
class procedure DestroyHandle(const AWinControl: TWinControl); override;
class procedure UpdateProperties(const ACustomPage: TCustomPage); override;
class procedure SetProperties(const ACustomPage: TCustomPage; ACocoaControl: NSTabViewItem);
//
@ -582,6 +583,18 @@ begin
end;
end;
class procedure TCocoaWSCustomPage.DestroyHandle(const AWinControl: TWinControl);
var
tv: TCocoaTabPageView;
ndx: Integer;
begin
tv := TCocoaTabPageView(AWinControl.Handle);
ndx := tv.tabView.exttabIndexOfTabViewItem(tv.tabPage);
if ndx >= 0 then
tv.tabview.exttabRemoveTabViewItem(tv.tabPage);
TCocoaWSWinControl.DestroyHandle(AWinControl);
end;
class procedure TCocoaWSCustomPage.UpdateProperties(const ACustomPage: TCustomPage);
var
lTabPage: TCocoaTabPage;