diff --git a/lcl/comctrls.pp b/lcl/comctrls.pp index 8f6c538ce3..e8a33b27f1 100644 --- a/lcl/comctrls.pp +++ b/lcl/comctrls.pp @@ -347,6 +347,7 @@ type procedure AddRemovePageHandle(APage: TCustomPage); procedure MoveTab(Sender: TObject; NewIndex: Integer); procedure SetMultiLine(const AValue: Boolean); + procedure SetStyle(AValue: TTabStyle); virtual; procedure WSMovePage(APage: TCustomPage; NewIndex: Integer); procedure PageRemoved(Index: Integer); procedure SetActivePage(const Value: String); @@ -393,7 +394,7 @@ type property OwnerDraw: Boolean read FOwnerDraw write FOwnerDraw default False; property RaggedRight: Boolean read FRaggedRight write FRaggedRight default False; property ScrollOpposite: Boolean read FScrollOpposite write FScrollOpposite default False; - property Style: TTabStyle read FStyle write FStyle default tsTabs; + property Style: TTabStyle read FStyle write SetStyle default tsTabs; property Tabs: TStrings read FAccess write SetPages; property TabHeight: Smallint read FTabHeight write FTabHeight default 0; property TabIndex: Integer read FPageIndex write SetPageIndex default -1; @@ -654,6 +655,8 @@ type private FNoteBook: TCustomTabControl{%H-}; FInHandleCreated: Boolean; + function GetStyle: TTabStyle; + procedure SetStyle(AValue: TTabStyle); protected function Get(Index: Integer): string; override; function GetCount: Integer; override; @@ -684,6 +687,7 @@ type procedure TabControlBoundsChange; override; function IndexOfTabAt(X, Y: Integer): Integer; override; property TabPosition: TTabPosition read GetTabPosition write SetTabPosition; + property Style: TTabStyle read GetStyle write SetStyle; public property NoteBook: TCustomTabControl read FNoteBook; end; @@ -719,7 +723,7 @@ type procedure SetOwnerDraw(const AValue: Boolean); procedure SetRaggedRight(const AValue: Boolean); procedure SetScrollOpposite(const AValue: Boolean); - procedure SetStyle(const AValue: TTabStyle); + procedure SetStyle(AValue: TTabStyle); override; procedure SetTabHeight(const AValue: Smallint); procedure SetTabPosition(AValue: TTabPosition); override; procedure SetTabs(const AValue: TStrings); diff --git a/lcl/include/customnotebook.inc b/lcl/include/customnotebook.inc index a707f0a826..dffbfd59df 100644 --- a/lcl/include/customnotebook.inc +++ b/lcl/include/customnotebook.inc @@ -626,6 +626,12 @@ begin Options := Options - [nboMultiLine]; end; +procedure TCustomTabControl.SetStyle(AValue: TTabStyle); +begin + if FStyle = AValue then Exit; + FStyle := AValue; +end; + {------------------------------------------------------------------------------ function TCustomTabControl.FindVisiblePage(Index: Integer): Integer; diff --git a/lcl/include/tabcontrol.inc b/lcl/include/tabcontrol.inc index 7cbadd0275..129f0ac7ce 100644 --- a/lcl/include/tabcontrol.inc +++ b/lcl/include/tabcontrol.inc @@ -187,6 +187,17 @@ begin TabControlBoundsChange; end; +procedure TTabControlNoteBookStrings.SetStyle(AValue: TTabStyle); +begin + FNoteBook.Style := AValue; + TabControlBoundsChange; +end; + +function TTabControlNoteBookStrings.GetStyle: TTabStyle; +begin + Result := FNoteBook.Style; +end; + function TTabControlNoteBookStrings.Get(Index: Integer): string; begin Result:=FNoteBook.Pages[Index]; @@ -453,11 +464,12 @@ begin TTabControlStrings(FTabs).ScrollOpposite:=AValue; end; -procedure TTabControl.SetStyle(const AValue: TTabStyle); +procedure TTabControl.SetStyle(AValue: TTabStyle); begin + inherited SetStyle(AValue); if FStyle=AValue then exit; FStyle:=AValue; - // ToDo + TTabControlNoteBookStrings(FTabs).Style := AValue; end; procedure TTabControl.SetTabHeight(const AValue: Smallint);