cocoa: fix tabVisible for active page. Patch by David Jenkins #35172

git-svn-id: trunk@61009 -
This commit is contained in:
dmitry 2019-04-18 03:59:20 +00:00
parent ff9256aff6
commit aecd84036e
2 changed files with 4 additions and 0 deletions

View File

@ -59,6 +59,7 @@ type
leftmost : Integer; // index of the left-most tab shown
public
ignoreChange: Boolean;
callback: ITabControlCallback;
fulltabs : NSMutableArray; // the full list of NSTabViewItems
@ -466,6 +467,7 @@ end;
procedure TCocoaTabControl.tabView_willSelectTabViewItem(tabView: NSTabView;
tabViewItem: NSTabViewItem);
begin
if ignoreChange then Exit;
if Assigned(callback) then
begin
callback.willSelectTabViewItem( IndexOfTab( self, tabViewItem) );

View File

@ -815,7 +815,9 @@ begin
i := TCocoaTabControl(ATabControl.Handle).fulltabs.indexOfObject( tb.tabPage );
if (i = NSNotFound) then Exit;
TCocoaTabControl(ATabControl.Handle).ignoreChange := True;
TCocoaTabControl(ATabControl.Handle).extselectTabViewItemAtIndex(NSInteger(i));
TCocoaTabControl(ATabControl.Handle).ignoreChange := False;
end;
class procedure TCocoaWSCustomTabControl.SetTabPosition(const ATabControl: TCustomTabControl; const ATabPosition: TTabPosition);