fixed TDefaultComponentEditor

git-svn-id: trunk@4029 -
This commit is contained in:
mattias 2003-04-09 10:11:06 +00:00
parent 0dcd66ea61
commit 49fa9c4074
4 changed files with 33 additions and 3 deletions

View File

@ -527,6 +527,16 @@ begin
LastGatheredIdentParent:=CurContextParent;
inc(LastGatheredIdentLevel);
end;
if FoundContext.Tool<>Self then begin
// identifier is in another unit
if (FoundContext.Node.Parent<>nil) then begin
if (FoundContext.Node.Parent.Desc=ctnClassPrivate) then begin
// skip private definitions in other units
exit;
end;
end;
end;
Ident:=nil;
case FoundContext.Node.Desc of

View File

@ -399,9 +399,7 @@ var
end;
begin
Continue:=false;
if not Assigned(FFirst)
and (Prop is TMethodPropertyEditor) then
if not Assigned(FFirst) and (Prop is TMethodPropertyEditor) then
FFirst := Prop;
PropName := Prop.GetName;
BestName := '';

View File

@ -78,6 +78,7 @@ type
function GetUnitName: string; virtual; abstract;
function GetPriority: TComponentPriority; virtual;
procedure AddToPalette; virtual;
function Createable: boolean; virtual;
public
property ComponentClass: TComponentClass read FComponentClass;
property PageName: string read FPageName;
@ -197,6 +198,11 @@ begin
IDEComponentPalette.AddComponent(Self);
end;
function TIDEComponent.Createable: boolean;
begin
Result:=true;
end;
{ TIDEComponentPage }
function TIDEComponentPage.GetItems(Index: integer): TIDEComponent;

View File

@ -72,6 +72,7 @@ type
procedure ConsistencyCheck; override;
function Icon: TBitmap;
function HasIcon: boolean;
function Createable: boolean; override;
public
property PkgFile: TPkgFile read FPkgFile write SetPkgFile;
end;
@ -115,6 +116,7 @@ type
private
FComponentPriority: TComponentPriority;
FComponents: TList; // list of TPkgComponent
FDeleted: boolean;
FFilename: string;
FFileType: TPkgFileType;
FFlags: TPkgFileFlags;
@ -122,6 +124,7 @@ type
FUnitName: string;
function GetComponents(Index: integer): TPkgComponent;
function GetHasRegisteredProc: boolean;
procedure SetDeleted(const AValue: boolean);
procedure SetFilename(const AValue: string);
procedure SetFileType(const AValue: TPkgFileType);
procedure SetFlags(const AValue: TPkgFileFlags);
@ -143,6 +146,7 @@ type
procedure RemovePkgComponent(APkgComponent: TPkgComponent);
function GetResolvedFilename: string;
public
property Deleted: boolean read FDeleted write SetDeleted;
property Filename: string read FFilename write SetFilename;
property FileType: TPkgFileType read FFileType write SetFileType;
property Flags: TPkgFileFlags read FFlags write SetFlags;
@ -509,6 +513,12 @@ begin
Result:=pffHasRegisterProc in FFlags;
end;
procedure TPkgFile.SetDeleted(const AValue: boolean);
begin
if FDeleted=AValue then exit;
FDeleted:=AValue;
end;
function TPkgFile.GetComponents(Index: integer): TPkgComponent;
begin
Result:=TPkgComponent(FComponents[Index]);
@ -567,6 +577,7 @@ end;
procedure TPkgFile.Clear;
begin
FDeleted:=false;
FFilename:='';
FFlags:=[];
FFileType:=pftUnit;
@ -1522,6 +1533,11 @@ begin
Result:=Page.PageName<>'';
end;
function TPkgComponent.Createable: boolean;
begin
Result:=not PkgFile.Deleted;
end;
{ TLazPackageID }
procedure TLazPackageID.SetName(const AValue: string);