cocoa: additional check on processing tab switch event. Need to investigate why a page view doesn't have any subview

git-svn-id: trunk@58514 -
This commit is contained in:
dmitry 2018-07-14 04:24:24 +00:00
parent fb5dac044d
commit f0aa55068a

View File

@ -236,12 +236,18 @@ var
begin
Result:=aTabIndex;
if not Assigned(trg) or not (trg is TCustomTabControl) then Exit;
if (aTabIndex<0) or (atabIndex>=src.fulltabs.count) then begin
if (aTabIndex<0) or (atabIndex>=src.fulltabs.count) then
begin
aTabIndex:=-1;
Exit;
end;
tbitem:=TCocoaTabPage(src.fulltabs.objectAtIndex(aTabIndex));
if NSView(tbitem.view).subviews.count=0 then
begin
aTabIndex:=-1;
Exit;
end;
hnd := HWND(NSView(tbitem.view).subviews.objectAtIndex(0));
tb:=TCustomTabControl(trg);