IdeIntf: Clean comp editor code, use new function EditCollectionNoAddDel instead of default param for old function.

git-svn-id: trunk@59117 -
This commit is contained in:
juha 2018-09-21 18:16:00 +00:00
parent 94c4596ba4
commit 76f7d02e9f
2 changed files with 12 additions and 14 deletions

View File

@ -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;

View File

@ -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;