IDEIntf: OI: show delete only for components

git-svn-id: trunk@39099 -
This commit is contained in:
mattias 2012-10-16 10:08:20 +00:00
parent 367c370cb7
commit 29f2e1409d

View File

@ -5140,6 +5140,8 @@ var
CurGrid: TOICustomPropertyGrid; CurGrid: TOICustomPropertyGrid;
CurRow: TOIPropertyGridRow; CurRow: TOIPropertyGridRow;
Persistent: TPersistent; Persistent: TPersistent;
AtLeastOneComponent: Boolean;
CanBeDeleted: Boolean;
begin begin
RemoveComponentEditorMenuItems; RemoveComponentEditorMenuItems;
ShowHintsPopupMenuItem.Checked := PropertyGrid.ShowHint; ShowHintsPopupMenuItem.Checked := PropertyGrid.ShowHint;
@ -5166,11 +5168,13 @@ begin
if (Selection.Count = 1) and (Selection[0] is TControl) then if (Selection.Count = 1) and (Selection[0] is TControl) then
AddZOrderMenuItems; AddZOrderMenuItems;
CutPopupMenuItem.Visible := (Selection.Count > 0) and (Selection[0] is TComponent); AtLeastOneComponent:=(Selection.Count > 0) and (Selection[0] is TComponent);
CopyPopupMenuItem.Visible := (Selection.Count > 0) and (Selection[0] is TComponent); CanBeDeleted:=AtLeastOneComponent;
PastePopupMenuItem.Visible := (Selection.Count > 0) and (Selection[0] is TComponent); CutPopupMenuItem.Visible := CanBeDeleted;
DeletePopupMenuItem.Visible := True; CopyPopupMenuItem.Visible := AtLeastOneComponent;
OptionsSeparatorMenuItem2.Visible := True; PastePopupMenuItem.Visible := AtLeastOneComponent;
DeletePopupMenuItem.Visible := CanBeDeleted;
OptionsSeparatorMenuItem2.Visible := AtLeastOneComponent;
end end
else else
begin begin