Moves ChildClassAllowed to TPageControl and ifdefs out the new tabcontrol

git-svn-id: trunk@31849 -
This commit is contained in:
sekelsenmat 2011-08-03 05:37:14 +00:00
parent 3677e97597
commit e102c28b17
4 changed files with 16 additions and 7 deletions

View File

@ -374,7 +374,6 @@ type
function DialogChar(var Message: TLMKey): boolean; override;
procedure ShowControl(APage: TControl); override;
procedure UpdateTabProperties; virtual;
function ChildClassAllowed(ChildClass: TClass): boolean; override;
class function GetControlClassDefaultSize: TSize; override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
property ActivePageComponent: TCustomPage read GetActivePageComponent
@ -510,6 +509,7 @@ type
procedure DoRemoveDockClient(Client: TControl); override;
function DoUndockClientMsg(NewTarget, Client: TControl):boolean; override;
procedure DoChange; override;
function ChildClassAllowed(ChildClass: TClass): boolean; override;
public
constructor Create(TheOwner: TComponent); override;
function FindNextPage(CurPage: TTabSheet;
@ -806,6 +806,8 @@ type
property Visible;
end;
{$ifdef LCL_NEW_TABCONTROL}
{ TNewTabControl }
(* TNewTabControl is a replacement for TTabControl, derived from TCustomTabControl.
@ -881,6 +883,8 @@ type
property Visible;
end;
{$endif}
{ Custom draw }
TCustomDrawTarget = (
@ -3452,7 +3456,9 @@ end;
procedure Register;
begin
RegisterComponents('Common Controls',[TTrackbar,TProgressBar,TTreeView,
TListView,TStatusBar,TToolBar,TUpDown,TPageControl,TTabControl,THeaderControl]);
TListView,TStatusBar,TToolBar,TUpDown,TPageControl,TTabControl,
{$ifdef LCL_NEW_TABCONTROL}TNewTabControl,{$endif}
THeaderControl]);
RegisterNoIcon([TToolButton,TTabSheet]);
end;

View File

@ -874,11 +874,6 @@ begin
TWSCustomPageClass(Page[i].WidgetSetClass).UpdateProperties(Page[i]);
end;
function TCustomTabControl.ChildClassAllowed(ChildClass: TClass): boolean;
begin
Result:=(ChildClass<>nil) and (ChildClass.InheritsFrom(PageClass));
end;
class function TCustomTabControl.GetControlClassDefaultSize: TSize;
begin
Result.CX := 200;

View File

@ -115,6 +115,11 @@ begin
OnChange(Self);
end;
function TPageControl.ChildClassAllowed(ChildClass: TClass): boolean;
begin
Result:=(ChildClass<>nil) and (ChildClass.InheritsFrom(PageClass));
end;
constructor TPageControl.Create(TheOwner: TComponent);
begin
PageClass:=TTabSheet;

View File

@ -689,6 +689,8 @@ begin
Result:=(FTabs<>nil) and TTabControlStrings(fTabs).IsUpdating;
end;
{$ifdef LCL_NEW_TABCONTROL}
{ TTabPage }
type
@ -838,6 +840,7 @@ begin
Dec(FPageIndex);
end;
end;
{$endif}
// included by comctrls.pp