IDEIntf: simplified

git-svn-id: trunk@59474 -
This commit is contained in:
mattias 2018-11-06 21:50:48 +00:00
parent ef7b5d394c
commit df79b8ffbb
2 changed files with 8 additions and 7 deletions

View File

@ -5358,16 +5358,18 @@ procedure TObjectInspectorDlg.ComponentRestrictedPaint(Sender: TObject);
var
I, J: Integer;
WidgetSetRestrictions: TWidgetSetRestrictionsArray;
RestrProp: TOIRestrictedProperty;
begin
if (RestrictedProps = nil) or (Selection = nil) then exit;
FillChar(WidgetSetRestrictions{%H-}, SizeOf(WidgetSetRestrictions), 0);
for I := 0 to RestrictedProps.Count - 1 do
begin
if RestrictedProps.Items[I] is TOIRestrictedProperty then
for J := 0 to Selection.Count - 1 do
with RestrictedProps.Items[I] as TOIRestrictedProperty do
CheckRestrictions(Selection[J].ClassType, WidgetSetRestrictions);
if not (RestrictedProps.Items[I] is TOIRestrictedProperty) then continue;
RestrProp:=TOIRestrictedProperty(RestrictedProps.Items[I]);
for J := 0 to Selection.Count - 1 do
with RestrProp do
CheckRestrictions(Selection[J].ClassType, WidgetSetRestrictions);
end;
RestrictedPaint(ComponentRestrictedBox, WidgetSetRestrictions);

View File

@ -49,11 +49,10 @@ type
protected
FWidgetSets: TLCLPlatforms;
public
function IsRestricted(AClass: TPersistentClass;
const APropertyName: string): TLCLPlatforms;
procedure CheckRestrictions(
AClass: TClass; var ARestrictions: TWidgetSetRestrictionsArray);
procedure CheckRestrictions(AClass: TClass;
var ARestrictions: TWidgetSetRestrictionsArray);// check restrictions for non properties
property WidgetSets: TLCLPlatforms read FWidgetSets write FWidgetSets;
end;