mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 19:52:26 +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
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user