fix carbon notebook moving page select switch

git-svn-id: trunk@21463 -
This commit is contained in:
dmitry 2009-08-27 12:24:56 +00:00
parent bb3984fa0a
commit d06b99c12b
2 changed files with 6 additions and 6 deletions

View File

@ -951,8 +951,6 @@ begin
ATab.Attach(Self); ATab.Attach(Self);
UpdateTabs; UpdateTabs;
// sync PageIndex with LCL
SetPageIndex(TCustomNotebook(LCLObject).PageIndex);
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -964,8 +962,6 @@ end;
procedure TCarbonTabsControl.Remove(AIndex: Integer); procedure TCarbonTabsControl.Remove(AIndex: Integer);
begin begin
Remove(FTabs[AIndex] as TCarbonTab); Remove(FTabs[AIndex] as TCarbonTab);
// sync PageIndex with LCL
SetPageIndex(TCustomNotebook(LCLObject).PageIndex);
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------

View File

@ -256,6 +256,8 @@ begin
AChild.HandleNeeded; AChild.HandleNeeded;
// add page // add page
TCarbonTabsControl(ANotebook.Handle).Add(TCarbonTab(AChild.Handle), AIndex); TCarbonTabsControl(ANotebook.Handle).Add(TCarbonTab(AChild.Handle), AIndex);
// sync PageIndex with LCL
TCarbonTabsControl(ANotebook.Handle).SetPageIndex(ANotebook.PageIndex);
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -271,7 +273,7 @@ class procedure TCarbonWSCustomNotebook.MovePage(const ANotebook: TCustomNoteboo
begin begin
if not CheckHandle(ANotebook, Self, 'MovePage') then Exit; if not CheckHandle(ANotebook, Self, 'MovePage') then Exit;
if not CheckHandle(AChild, Self, 'MovePage AChild') then Exit; if not CheckHandle(AChild, Self, 'MovePage AChild') then Exit;
TCarbonTabsControl(ANotebook.Handle).Remove(AChild.PageIndex); TCarbonTabsControl(ANotebook.Handle).Remove(AChild.PageIndex);
TCarbonTabsControl(ANotebook.Handle).Add(TCarbonTab(AChild.Handle), NewIndex); TCarbonTabsControl(ANotebook.Handle).Add(TCarbonTab(AChild.Handle), NewIndex);
end; end;
@ -289,6 +291,8 @@ begin
if not CheckHandle(ANotebook, Self, 'RemovePage') then Exit; if not CheckHandle(ANotebook, Self, 'RemovePage') then Exit;
TCarbonTabsControl(ANotebook.Handle).Remove(AIndex); TCarbonTabsControl(ANotebook.Handle).Remove(AIndex);
// sync PageIndex with LCL
TCarbonTabsControl(ANotebook.Handle).SetPageIndex(ANotebook.PageIndex);
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -302,7 +306,7 @@ class procedure TCarbonWSCustomNotebook.SetPageIndex(const ANotebook: TCustomNot
const AIndex: integer); const AIndex: integer);
begin begin
if not CheckHandle(ANotebook, Self, 'SetPageIndex') then Exit; if not CheckHandle(ANotebook, Self, 'SetPageIndex') then Exit;
TCarbonTabsControl(ANotebook.Handle).SetPageIndex(AIndex); TCarbonTabsControl(ANotebook.Handle).SetPageIndex(AIndex);
end; end;