mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 04:39:22 +02:00
MG: added exception message on designed component deletion
git-svn-id: trunk@3540 -
This commit is contained in:
parent
5a82543198
commit
9464792e01
@ -562,11 +562,32 @@ Begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
Function TComponentInterface.Delete: Boolean;
|
Function TComponentInterface.Delete: Boolean;
|
||||||
|
var
|
||||||
|
OldName, OldClassName: string;
|
||||||
Begin
|
Begin
|
||||||
{$IFDEF VerboseFormEditor}
|
{$IFDEF VerboseFormEditor}
|
||||||
writeln('TComponentInterface.Delete A ',Component.Name,':',Component.ClassName);
|
writeln('TComponentInterface.Delete A ',Component.Name,':',Component.ClassName);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
{$IFNDEF NoCompCatch}
|
||||||
|
try
|
||||||
|
{$ENDIF}
|
||||||
|
OldName:=Component.Name;
|
||||||
|
OldClassName:=Component.ClassName;
|
||||||
Component.Free;
|
Component.Free;
|
||||||
|
{$IFNDEF NoCompCatch}
|
||||||
|
except
|
||||||
|
on E: Exception do begin
|
||||||
|
writeln('TComponentInterface.Delete ERROR:',
|
||||||
|
' "'+OldName+':'+OldClassName+'" ',E.Message);
|
||||||
|
MessageDlg('Error',
|
||||||
|
'An exception occured during deletion of'#13
|
||||||
|
+'"'+OldName+':'+OldClassName+'"'#13
|
||||||
|
+E.Message,
|
||||||
|
mtError,[mbOk],0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
FComponent:=nil;
|
||||||
{$IFDEF VerboseFormEditor}
|
{$IFDEF VerboseFormEditor}
|
||||||
writeln('TComponentInterface.Delete B ');
|
writeln('TComponentInterface.Delete B ');
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
Loading…
Reference in New Issue
Block a user