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 -
This commit is contained in:
mattias 2006-10-03 20:54:36 +00:00
parent 0c077319da
commit 3f65db6fa4

View File

@ -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;