IDE: Move SelectButton from ComponentReg interface to TComponentPage.

git-svn-id: trunk@48305 -
This commit is contained in:
juha 2015-03-12 23:01:48 +00:00
parent 159ba4fccf
commit 443c7df5a4
2 changed files with 5 additions and 4 deletions

View File

@ -134,7 +134,6 @@ type
private
FPageName: string;
FPalette: TBaseComponentPalette;
FSelectButton: TComponent;
FVisible: boolean;
protected
procedure SetVisible(const AValue: boolean); virtual;
@ -145,7 +144,6 @@ type
public
property PageName: string read FPageName;
property Palette: TBaseComponentPalette read FPalette write FPalette;
property SelectButton: TComponent read FSelectButton write FSelectButton;
property Visible: boolean read FVisible write SetVisible;
end;
@ -553,7 +551,6 @@ end;
destructor TBaseComponentPage.Destroy;
begin
FreeAndNil(FSelectButton);
inherited Destroy;
end;

View File

@ -82,6 +82,7 @@ type
TComponentPage = class(TBaseComponentPage)
private
fPageComponent: TCustomPage;
fSelectButton: TComponent;
fBtnIndex: integer;
fIndex: Integer; // Index in the Pages container.
fCompNames: TStringList; // Reference to component names.
@ -98,7 +99,9 @@ type
constructor Create(const ThePageName: string);
destructor Destroy; override;
function GetScrollBox: TScrollBox;
public
property PageComponent: TCustomPage read fPageComponent write fPageComponent;
property SelectButton: TComponent read fSelectButton write fSelectButton;
end;
{ TComponentPalette }
@ -305,6 +308,7 @@ end;
destructor TComponentPage.Destroy;
begin
FreeAndNil(fSelectButton);
FreeAndNil(fPageComponent);
inherited Destroy;
end;
@ -820,7 +824,7 @@ begin
for i:=0 to Pages.Count-1 do begin
CurPage:=Pages[i];
if (FSelected=nil) or (FSelected.RealPage<>CurPage) then begin
SelectButtonOnPage:=TSpeedButton(CurPage.SelectButton);
SelectButtonOnPage:=TSpeedButton(TComponentPage(CurPage).SelectButton);
if SelectButtonOnPage<>nil then
SelectButtonOnPage.Down:=true;
end;