fixed GetComponentEditor for TDataModule

git-svn-id: trunk@4368 -
This commit is contained in:
mattias 2003-07-04 14:50:53 +00:00
parent 24a16e5441
commit c967b48082

View File

@ -311,31 +311,22 @@ end;
function TComponentInterface.GetDesigner: TComponentEditorDesigner; function TComponentInterface.GetDesigner: TComponentEditorDesigner;
var var
OwnerForm: TCustomForm; DesignerForm: TCustomForm;
begin begin
if FDesigner=nil then begin if FDesigner=nil then begin
if (Component is TCustomForm) and (TCustomForm(Component).Parent=nil) then DesignerForm:=GetDesignerForm(Component);
OwnerForm:=TCustomForm(Component) if DesignerForm=nil then begin
else begin raise Exception.Create('TComponentInterface.GetDesigner: '
OwnerForm:=TCustomForm(Component.Owner); +Component.Name+' DesignerForm=nil');
if OwnerForm=nil then begin
raise Exception.Create('TComponentInterface.GetDesigner: '
+Component.Name+' Owner=nil');
end;
if not (OwnerForm is TCustomForm) then begin
raise Exception.Create('TComponentInterface.GetDesigner: '
+Component.Name+' OwnerForm='+OwnerForm.ClassName);
end;
end; end;
FDesigner:=TComponentEditorDesigner(OwnerForm.Designer); FDesigner:=TComponentEditorDesigner(DesignerForm.Designer);
if FDesigner=nil then begin if FDesigner=nil then begin
raise Exception.Create('TComponentInterface.GetDesigner: ' raise Exception.Create('TComponentInterface.GetDesigner: '
+Component.Name+' Designer=nil'); +Component.Name+' Designer=nil');
end; end;
if not (FDesigner is TComponentEditorDesigner) then begin if not (FDesigner is TComponentEditorDesigner) then begin
raise Exception.Create('TComponentInterface.GetDesigner: ' raise Exception.Create('TComponentInterface.GetDesigner: '
+Component.Name+' Designer='+ +Component.Name+' Designer='+FDesigner.ClassName);
+FDesigner.ClassName);
end; end;
end; end;
Result:=FDesigner; Result:=FDesigner;