From 76f7d02e9f1f861a45ce8fa93a410bbcbf5bfd9a Mon Sep 17 00:00:00 2001 From: juha Date: Fri, 21 Sep 2018 18:16:00 +0000 Subject: [PATCH] IdeIntf: Clean comp editor code, use new function EditCollectionNoAddDel instead of default param for old function. git-svn-id: trunk@59117 - --- components/ideintf/componenteditors.pas | 9 +++------ components/ideintf/propedits.pp | 17 +++++++++-------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/components/ideintf/componenteditors.pas b/components/ideintf/componenteditors.pas index dbbcc527d9..be416267a9 100644 --- a/components/ideintf/componenteditors.pas +++ b/components/ideintf/componenteditors.pas @@ -398,8 +398,8 @@ type TFlowPanelComponentEditor = class(TComponentEditor) public - procedure ExecuteVerb(AIndex: Integer); override; - function GetVerb(AIndex: Integer): string; override; + procedure ExecuteVerb({%H-}AIndex: Integer); override; + function GetVerb({%H-}AIndex: Integer): string; override; function GetVerbCount: Integer; override; function FlowPanel: TFlowPanel; end; @@ -1268,12 +1268,9 @@ end; { TFlowPanelComponentEditor } -var - FlowPanelEditor: TCollectionPropertyEditor = nil; - procedure TFlowPanelComponentEditor.ExecuteVerb(AIndex: Integer); begin - EditCollection(FlowPanel, FlowPanel.ControlList, 'ControlList', true); + EditCollectionNoAddDel(FlowPanel, FlowPanel.ControlList, 'ControlList'); end; function TFlowPanelComponentEditor.GetVerb(AIndex: Integer): string; diff --git a/components/ideintf/propedits.pp b/components/ideintf/propedits.pp index b3f309a967..6443b33f10 100644 --- a/components/ideintf/propedits.pp +++ b/components/ideintf/propedits.pp @@ -1766,8 +1766,8 @@ function ControlAcceptsStreamableChildComponent(aControl: TWinControl; procedure LazSetMethodProp(Instance : TObject;PropInfo : PPropInfo; Value : TMethod); procedure WritePublishedProperties(Instance: TPersistent); -procedure EditCollection(AComponent: TComponent; ACollection: TCollection; - APropertyName: String; NoAddDelete: Boolean = false); +procedure EditCollection(AComponent: TComponent; ACollection: TCollection; APropName: String); +procedure EditCollectionNoAddDel(AComponent: TComponent; ACollection: TCollection; APropName: String); // Returns true if given property should be displayed on the property list // filtered by AFilter and APropNameFilter. @@ -7516,13 +7516,14 @@ begin Result := Pos(AUpperSubText, UpperCase(AText)) > 0; end; -procedure EditCollection(AComponent: TComponent; ACollection: TCollection; - APropertyName: String; NoAddDelete: Boolean = false); +procedure EditCollection(AComponent: TComponent; ACollection: TCollection; APropName: String); begin - if NoAddDelete then - TNoAddDeleteCollectionPropertyEditor.ShowCollectionEditor(ACollection, AComponent, APropertyName) - else - TCollectionPropertyEditor.ShowCollectionEditor(ACollection, AComponent, APropertyName); + TCollectionPropertyEditor.ShowCollectionEditor(ACollection, AComponent, APropName); +end; + +procedure EditCollectionNoAddDel(AComponent: TComponent; ACollection: TCollection; APropName: String); +begin + TNoAddDeleteCollectionPropertyEditor.ShowCollectionEditor(ACollection, AComponent, APropName); end; function IsInteresting(AEditor: TPropertyEditor; const AFilter: TTypeKinds;