diff --git a/lcl/comctrls.pp b/lcl/comctrls.pp index 72925fc53d..18f05f8b59 100644 --- a/lcl/comctrls.pp +++ b/lcl/comctrls.pp @@ -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; diff --git a/lcl/include/customnotebook.inc b/lcl/include/customnotebook.inc index b66ab8fde4..4cc0fe2990 100644 --- a/lcl/include/customnotebook.inc +++ b/lcl/include/customnotebook.inc @@ -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; diff --git a/lcl/include/pagecontrol.inc b/lcl/include/pagecontrol.inc index f2c409a186..166e6bbb3c 100644 --- a/lcl/include/pagecontrol.inc +++ b/lcl/include/pagecontrol.inc @@ -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; diff --git a/lcl/include/tabcontrol.inc b/lcl/include/tabcontrol.inc index 0d5a03b1fc..d15989559b 100644 --- a/lcl/include/tabcontrol.inc +++ b/lcl/include/tabcontrol.inc @@ -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