mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 23:00:27 +02:00
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:
parent
0c077319da
commit
3f65db6fa4
17
ide/main.pp
17
ide/main.pp
@ -4862,10 +4862,16 @@ begin
|
|||||||
if (AncestorType=nil) then begin
|
if (AncestorType=nil) then begin
|
||||||
Result:=DoLoadHiddenResourceComponent(AnUnitInfo,AncestorClassName,Flags,
|
Result:=DoLoadHiddenResourceComponent(AnUnitInfo,AncestorClassName,Flags,
|
||||||
AncestorType,AncestorUnitInfo);
|
AncestorType,AncestorUnitInfo);
|
||||||
if Result<>mrOk then exit;
|
if Result=mrAbort then exit;
|
||||||
Result:=DoSaveFileResourceToBinStream(AncestorUnitInfo,AncestorBinStream);
|
if Result=mrOk then begin
|
||||||
if Result<>mrOk then exit;
|
Result:=DoSaveFileResourceToBinStream(AncestorUnitInfo,AncestorBinStream);
|
||||||
AncestorBinStream.Position:=0;
|
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;
|
end;
|
||||||
|
|
||||||
// use TForm as default ancestor
|
// use TForm as default ancestor
|
||||||
@ -5108,7 +5114,8 @@ begin
|
|||||||
Result:=QuestionDlg('Error','Unable to find the lfm file for component class '
|
Result:=QuestionDlg('Error','Unable to find the lfm file for component class '
|
||||||
+'"'+AComponentClassName+'".',
|
+'"'+AComponentClassName+'".',
|
||||||
mtError,[mrCancel,'Cancel loading this component',
|
mtError,[mrCancel,'Cancel loading this component',
|
||||||
mrAbort,'Abort whole loading'],0);
|
mrAbort,'Abort whole loading',
|
||||||
|
mrIgnore,'Ignore, use TForm as ancestor'],0);
|
||||||
finally
|
finally
|
||||||
AnUnitInfo.LoadingComponent:=false;
|
AnUnitInfo.LoadingComponent:=false;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user