mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 16:42:06 +02:00
IdeIntf: Remove LCL dependency from unit ComponentReg. Adjust TRegisteredComponent method visibility.
This commit is contained in:
parent
3aaae1a6a8
commit
2c7e959e62
@ -25,8 +25,6 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, TypInfo, AVL_Tree, fgl,
|
Classes, SysUtils, TypInfo, AVL_Tree, fgl,
|
||||||
// LCL
|
|
||||||
Controls,
|
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazUtilities, LazLoggerBase, Laz2_XMLCfg, LazMethodList, LazUTF8;
|
LazUtilities, LazLoggerBase, Laz2_XMLCfg, LazMethodList, LazUTF8;
|
||||||
|
|
||||||
@ -148,29 +146,30 @@ type
|
|||||||
FOrigPageName: string;
|
FOrigPageName: string;
|
||||||
FRealPage: TBaseComponentPage;
|
FRealPage: TBaseComponentPage;
|
||||||
FVisible: boolean;
|
FVisible: boolean;
|
||||||
protected
|
|
||||||
FNextSameName: TRegisteredComponent;
|
FNextSameName: TRegisteredComponent;
|
||||||
FPrevSameName: TRegisteredComponent;
|
FPrevSameName: TRegisteredComponent;
|
||||||
|
procedure AddToPalette;
|
||||||
|
protected
|
||||||
|
function CanBeCreatedInDesigner: boolean; virtual;
|
||||||
|
procedure ConsistencyCheck; virtual;
|
||||||
|
function GetPriority: TComponentPriority; virtual;
|
||||||
|
function InheritsFromControl: boolean; virtual; abstract;
|
||||||
public
|
public
|
||||||
constructor Create(TheComponentClass: TComponentClass; const ThePageName: string);
|
constructor Create(TheComponentClass: TComponentClass; const ThePageName: string);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure ConsistencyCheck; virtual;
|
|
||||||
function GetUnitName: string; virtual; abstract;
|
|
||||||
function GetPriority: TComponentPriority; virtual;
|
|
||||||
procedure AddToPalette; virtual;
|
|
||||||
function CanBeCreatedInDesigner: boolean; virtual;
|
|
||||||
function GetCreationClass: TComponentClass; virtual;
|
function GetCreationClass: TComponentClass; virtual;
|
||||||
function HasAmbiguousClassName: boolean; virtual; // true if another component class with same name (different unit) is registered
|
|
||||||
function GetFullClassName(const UnitSep: char = '/'): string; virtual;
|
function GetFullClassName(const UnitSep: char = '/'): string; virtual;
|
||||||
|
function GetUnitName: string; virtual; abstract;
|
||||||
|
function HasAmbiguousClassName: boolean; virtual; // true if another component class with same name (different unit) is registered
|
||||||
public
|
public
|
||||||
property ComponentClass: TComponentClass read FComponentClass; // Beware of ambiguous classnames
|
property ComponentClass: TComponentClass read FComponentClass; // Beware of ambiguous classnames
|
||||||
property OnGetCreationClass: TOnGetCreationClass read FOnGetCreationClass
|
|
||||||
write FOnGetCreationClass;
|
|
||||||
property OrigPageName: string read FOrigPageName; // case sensitive
|
property OrigPageName: string read FOrigPageName; // case sensitive
|
||||||
property RealPage: TBaseComponentPage read FRealPage write FRealPage;
|
property RealPage: TBaseComponentPage read FRealPage write FRealPage;
|
||||||
property Visible: boolean read FVisible write FVisible;
|
property Visible: boolean read FVisible write FVisible;
|
||||||
property NextSameName: TRegisteredComponent read FNextSameName;
|
property NextSameName: TRegisteredComponent read FNextSameName;
|
||||||
property PrevSameName: TRegisteredComponent read FPrevSameName;
|
property PrevSameName: TRegisteredComponent read FPrevSameName;
|
||||||
|
property OnGetCreationClass: TOnGetCreationClass read FOnGetCreationClass
|
||||||
|
write FOnGetCreationClass;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TBaseComponentPage }
|
{ TBaseComponentPage }
|
||||||
@ -1284,7 +1283,7 @@ var
|
|||||||
i, Vote: Integer;
|
i, Vote: Integer;
|
||||||
begin
|
begin
|
||||||
Vote:=1;
|
Vote:=1;
|
||||||
if HideControls and AComponent.ComponentClass.InheritsFrom(TControl) then
|
if HideControls and AComponent.InheritsFromControl then
|
||||||
Dec(Vote);
|
Dec(Vote);
|
||||||
i:=FHandlers[cphtVoteVisibility].Count;
|
i:=FHandlers[cphtVoteVisibility].Count;
|
||||||
while FHandlers[cphtVoteVisibility].NextDownIndex(i) do
|
while FHandlers[cphtVoteVisibility].NextDownIndex(i) do
|
||||||
|
@ -40,7 +40,7 @@ uses
|
|||||||
// FCL
|
// FCL
|
||||||
Classes, SysUtils, Contnrs, TypInfo, AVL_Tree, System.UITypes,
|
Classes, SysUtils, Contnrs, TypInfo, AVL_Tree, System.UITypes,
|
||||||
// LCL
|
// LCL
|
||||||
Forms, ImgList,
|
Forms, Controls, ImgList,
|
||||||
// Codetools
|
// Codetools
|
||||||
LazConfigStorage, DefineTemplates, CodeToolManager,
|
LazConfigStorage, DefineTemplates, CodeToolManager,
|
||||||
CodeCache, CodeToolsCfgScript, CodeToolsStructs, BasicCodeTools,
|
CodeCache, CodeToolsCfgScript, CodeToolsStructs, BasicCodeTools,
|
||||||
@ -90,17 +90,19 @@ type
|
|||||||
private
|
private
|
||||||
FPkgFile: TPkgFile;
|
FPkgFile: TPkgFile;
|
||||||
procedure SetPkgFile(const AValue: TPkgFile);
|
procedure SetPkgFile(const AValue: TPkgFile);
|
||||||
|
protected
|
||||||
|
function CanBeCreatedInDesigner: boolean; override;
|
||||||
|
procedure ConsistencyCheck; override;
|
||||||
|
function GetPriority: TComponentPriority; override;
|
||||||
|
function InheritsFromControl: boolean; override;
|
||||||
public
|
public
|
||||||
constructor Create(ThePkgFile: TPkgFile; TheComponentClass: TComponentClass;
|
constructor Create(ThePkgFile: TPkgFile; TheComponentClass: TComponentClass;
|
||||||
const ThePageName: string);
|
const ThePageName: string);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function GetUnitName: string; override;
|
function GetUnitName: string; override;
|
||||||
function GetPriority: TComponentPriority; override;
|
function HasIcon: boolean;
|
||||||
procedure ConsistencyCheck; override;
|
|
||||||
function ImageIndex: TImageIndex;
|
function ImageIndex: TImageIndex;
|
||||||
class function Images: TCustomImageList;
|
class function Images: TCustomImageList;
|
||||||
function HasIcon: boolean;
|
|
||||||
function CanBeCreatedInDesigner: boolean; override;
|
|
||||||
public
|
public
|
||||||
property PkgFile: TPkgFile read FPkgFile write SetPkgFile;
|
property PkgFile: TPkgFile read FPkgFile write SetPkgFile;
|
||||||
end;
|
end;
|
||||||
@ -4052,6 +4054,11 @@ begin
|
|||||||
if (FPkgFile<>nil) then PkgFile.AddPkgComponent(Self);
|
if (FPkgFile<>nil) then PkgFile.AddPkgComponent(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TPkgComponent.InheritsFromControl: boolean;
|
||||||
|
begin
|
||||||
|
Result:=ComponentClass.InheritsFrom(TControl);
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TPkgComponent.Create(ThePkgFile: TPkgFile;
|
constructor TPkgComponent.Create(ThePkgFile: TPkgFile;
|
||||||
TheComponentClass: TComponentClass; const ThePageName: string);
|
TheComponentClass: TComponentClass; const ThePageName: string);
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user