From 3f65db6fa4ebc15383eed1e8701dc15e1be434bc Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 3 Oct 2006 20:54:36 +0000 Subject: [PATCH] IDE: when ancestor class of designer form is not found, give user choice to Ignore and use TForm as ancestor git-svn-id: trunk@10031 - --- ide/main.pp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ide/main.pp b/ide/main.pp index 084e4d34fe..e8293290d9 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -4862,10 +4862,16 @@ begin if (AncestorType=nil) then begin Result:=DoLoadHiddenResourceComponent(AnUnitInfo,AncestorClassName,Flags, AncestorType,AncestorUnitInfo); - if Result<>mrOk then exit; - Result:=DoSaveFileResourceToBinStream(AncestorUnitInfo,AncestorBinStream); - if Result<>mrOk then exit; - AncestorBinStream.Position:=0; + if Result=mrAbort then exit; + if Result=mrOk then begin + Result:=DoSaveFileResourceToBinStream(AncestorUnitInfo,AncestorBinStream); + if Result<>mrOk then exit; + AncestorBinStream.Position:=0; + end else begin + // the ancestor class was not found -> use TForm as default + AncestorType:=TForm; + AncestorUnitInfo:=nil; + end; end; // use TForm as default ancestor @@ -5108,7 +5114,8 @@ begin Result:=QuestionDlg('Error','Unable to find the lfm file for component class ' +'"'+AComponentClassName+'".', mtError,[mrCancel,'Cancel loading this component', - mrAbort,'Abort whole loading'],0); + mrAbort,'Abort whole loading', + mrIgnore,'Ignore, use TForm as ancestor'],0); finally AnUnitInfo.LoadingComponent:=false; end;