diff --git a/components/ideintf/graphicpropedit.lfm b/components/ideintf/graphicpropedit.lfm index d06fa226c8..5d0366fe72 100644 --- a/components/ideintf/graphicpropedit.lfm +++ b/components/ideintf/graphicpropedit.lfm @@ -203,6 +203,7 @@ object GraphicPropertyEditorForm: TGraphicPropertyEditorForm Hint = 'Delete' ShortCut = 46 OnExecute = ClearActionExecute + OnUpdate = ClearActionUpdate end end end diff --git a/components/ideintf/graphicpropedit.pas b/components/ideintf/graphicpropedit.pas index 29e9cf4ceb..2f0fb74066 100644 --- a/components/ideintf/graphicpropedit.pas +++ b/components/ideintf/graphicpropedit.pas @@ -47,6 +47,7 @@ type GroupBox1: TGroupBox; SaveDialog: TSavePictureDialog; ScrollBox: TScrollBox; + procedure ClearActionUpdate(Sender: TObject); procedure CopyActionExecute(Sender: TObject); procedure CopyActionUpdate(Sender: TObject); procedure FormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction); @@ -115,6 +116,11 @@ begin Clipboard.Assign(ImagePreview.Picture.Graphic); end; +procedure TGraphicPropertyEditorForm.ClearActionUpdate(Sender: TObject); +begin + ClearAction.Enabled := ImagePreview.Picture.Graphic <> nil; +end; + procedure TGraphicPropertyEditorForm.CopyActionUpdate(Sender: TObject); begin CopyAction.Enabled := ImagePreview.Picture.Graphic <> nil;