mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 18:23:46 +02:00
ideintf: add TComponentEditorDesigner CanCopy method similar to CanPaste
git-svn-id: trunk@35966 -
This commit is contained in:
parent
694635da21
commit
519194cb6c
@ -261,6 +261,7 @@ type
|
||||
procedure SelectOnlyThisComponent(AComponent: TComponent); override;
|
||||
function CopySelection: boolean; override;
|
||||
function CutSelection: boolean; override;
|
||||
function CanCopy: Boolean; override;
|
||||
function CanPaste: Boolean; override;
|
||||
function PasteSelection(PasteFlags: TComponentPasteSelectionFlags): boolean; override;
|
||||
function DeleteSelection: boolean; override;
|
||||
@ -1370,11 +1371,19 @@ begin
|
||||
Result := DoCopySelectionToClipboard and DoDeleteSelectedPersistents;
|
||||
end;
|
||||
|
||||
function TDesigner.CanCopy: Boolean;
|
||||
begin
|
||||
Result := (ControlSelection.Count > 0) and
|
||||
(ControlSelection.SelectionForm = Form) and
|
||||
not ControlSelection.OnlyInvisiblePersistentsSelected and
|
||||
not ControlSelection.LookupRootSelected;
|
||||
end;
|
||||
|
||||
function TDesigner.CanPaste: Boolean;
|
||||
begin
|
||||
Result:=(Form<>nil)
|
||||
and (FLookupRoot<>nil)
|
||||
and (not (csDestroying in FLookupRoot.ComponentState));
|
||||
Result:= Assigned(Form) and
|
||||
Assigned(FLookupRoot) and
|
||||
not (csDestroying in FLookupRoot.ComponentState);
|
||||
end;
|
||||
|
||||
function TDesigner.PasteSelection(
|
||||
@ -3593,8 +3602,8 @@ begin
|
||||
DesignerMenuOrderForwardOne.Enabled := OneControlSelected and not OnlyNonVisualsAreSelected;
|
||||
DesignerMenuOrderBackOne.Enabled := OneControlSelected and not OnlyNonVisualsAreSelected;
|
||||
|
||||
DesignerMenuCut.Enabled := CompsAreSelected;
|
||||
DesignerMenuCopy.Enabled := CompsAreSelected;
|
||||
DesignerMenuCut.Enabled := CanCopy;
|
||||
DesignerMenuCopy.Enabled := CanCopy;
|
||||
DesignerMenuPaste.Enabled := CanPaste;
|
||||
DesignerMenuDeleteSelection.Enabled := CompsAreSelected;
|
||||
|
||||
|
@ -58,7 +58,8 @@ type
|
||||
procedure Modified; override;
|
||||
function CopySelection: boolean; virtual; abstract;
|
||||
function CutSelection: boolean; virtual; abstract;
|
||||
function CanPaste: boolean; virtual; abstract;
|
||||
function CanCopy: Boolean; virtual; abstract;
|
||||
function CanPaste: Boolean; virtual; abstract;
|
||||
function PasteSelection(Flags: TComponentPasteSelectionFlags): boolean; virtual; abstract;
|
||||
function DeleteSelection: boolean; virtual; abstract;
|
||||
function CopySelectionToStream(s: TStream): boolean; virtual; abstract;
|
||||
|
Loading…
Reference in New Issue
Block a user