mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-05 05:18:17 +02:00
fix carbon notebook moving page select switch
git-svn-id: trunk@21463 -
This commit is contained in:
parent
bb3984fa0a
commit
d06b99c12b
@ -951,8 +951,6 @@ begin
|
||||
ATab.Attach(Self);
|
||||
|
||||
UpdateTabs;
|
||||
// sync PageIndex with LCL
|
||||
SetPageIndex(TCustomNotebook(LCLObject).PageIndex);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -964,8 +962,6 @@ end;
|
||||
procedure TCarbonTabsControl.Remove(AIndex: Integer);
|
||||
begin
|
||||
Remove(FTabs[AIndex] as TCarbonTab);
|
||||
// sync PageIndex with LCL
|
||||
SetPageIndex(TCustomNotebook(LCLObject).PageIndex);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -256,6 +256,8 @@ begin
|
||||
AChild.HandleNeeded;
|
||||
// add page
|
||||
TCarbonTabsControl(ANotebook.Handle).Add(TCarbonTab(AChild.Handle), AIndex);
|
||||
// sync PageIndex with LCL
|
||||
TCarbonTabsControl(ANotebook.Handle).SetPageIndex(ANotebook.PageIndex);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -271,7 +273,7 @@ class procedure TCarbonWSCustomNotebook.MovePage(const ANotebook: TCustomNoteboo
|
||||
begin
|
||||
if not CheckHandle(ANotebook, Self, 'MovePage') then Exit;
|
||||
if not CheckHandle(AChild, Self, 'MovePage AChild') then Exit;
|
||||
|
||||
|
||||
TCarbonTabsControl(ANotebook.Handle).Remove(AChild.PageIndex);
|
||||
TCarbonTabsControl(ANotebook.Handle).Add(TCarbonTab(AChild.Handle), NewIndex);
|
||||
end;
|
||||
@ -289,6 +291,8 @@ begin
|
||||
if not CheckHandle(ANotebook, Self, 'RemovePage') then Exit;
|
||||
|
||||
TCarbonTabsControl(ANotebook.Handle).Remove(AIndex);
|
||||
// sync PageIndex with LCL
|
||||
TCarbonTabsControl(ANotebook.Handle).SetPageIndex(ANotebook.PageIndex);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -302,7 +306,7 @@ class procedure TCarbonWSCustomNotebook.SetPageIndex(const ANotebook: TCustomNot
|
||||
const AIndex: integer);
|
||||
begin
|
||||
if not CheckHandle(ANotebook, Self, 'SetPageIndex') then Exit;
|
||||
|
||||
|
||||
TCarbonTabsControl(ANotebook.Handle).SetPageIndex(AIndex);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user