IDE: Fixed components with published properties of type "interface" does not work. Issue #32919. Patch by Andi Friess

git-svn-id: trunk@57332 -
This commit is contained in:
michl 2018-02-19 23:42:46 +00:00
parent e34bbc5c6f
commit c582885e5c
2 changed files with 25 additions and 2 deletions

View File

@ -2204,7 +2204,10 @@ begin
if (not (paSubProperties in Row.Editor.GetAttributes)) then exit;
// check if circling
if (Row.Editor is TPersistentPropertyEditor) then begin
AnObject:=TPersistent(Row.Editor.GetObjectValue);
if (Row.Editor is TInterfacePropertyEditor) then
AnObject:=TPersistent(Row.Editor.GetIntfValue)
else
AnObject:=TPersistent(Row.Editor.GetObjectValue);
if FSelection.IndexOf(AnObject)>=0 then exit;
ParentRow:=Row.Parent;
while ParentRow<>nil do begin

View File

@ -747,6 +747,7 @@ type
function GetSelections: TPersistentSelectionList; override;
public
function AllEqual: Boolean; override;
procedure Edit; override;
function GetAttributes: TPropertyAttributes; override;
procedure GetValues(Proc: TGetStrProc); override;
procedure SetValue(const NewValue: string); override;
@ -5089,9 +5090,28 @@ begin
Result := True;
end;
procedure TInterfacePropertyEditor.Edit;
var
Temp: TPersistent;
Designer: TIDesigner;
AComponent: TComponent;
begin
Temp := GetComponentReference;
if Temp is TComponent then begin
AComponent:=TComponent(Temp);
Designer:=FindRootDesigner(AComponent);
if (Designer<>nil)
and (Designer.GetShiftState * [ssCtrl, ssLeft] = [ssCtrl, ssLeft]) then
Designer.SelectOnlyThisComponent(AComponent)
else
inherited Edit;
end else
inherited Edit;
end;
function TInterfacePropertyEditor.GetAttributes: TPropertyAttributes;
begin
Result := [paMultiSelect];
Result := [paMultiSelect];
if Assigned(GetPropInfo^.SetProc) then
Result := Result + [paValueList, paSortList, paRevertable, paVolatileSubProperties]
else