fixed triggering TDataModule, and improved parent search for new designer controls. from Jesus

git-svn-id: trunk@7137 -
This commit is contained in:
mattias 2005-05-03 16:52:29 +00:00
parent 5e5c593414
commit 18509cdbd9
2 changed files with 16 additions and 7 deletions

View File

@ -1252,12 +1252,18 @@ Begin
// create component interface
Temp := TComponentInterface.Create(NewComponent);
// calc parent
if (ParentComponent is TWinControl)
and (csAcceptsControls in TWinControl(ParentComponent).ControlStyle) then
begin
AParent := TWinControl(ParentComponent);
end else begin
AParent := TControl(ParentComponent).Parent;
AParent:=nil;
if ParentComponent is TControl then begin
if (ParentComponent is TWinControl) then
AParent:=TWinControl(ParentComponent)
else
AParent:=TControl(ParentComponent).Parent;
while (AParent<>nil) do begin
if (AParent is TWinControl)
and (csAcceptsControls in AParent.ControlStyle) then
break;
AParent:=AParent.Parent;
end;
end;
DebugLn('Parent is '''+dbgsName(AParent)+'''');
end else begin

View File

@ -1432,7 +1432,7 @@ begin
ProcessMessages;
end;
end;
{$IFNDEF AfterConstructionDataModuleNotWorking}
{$IFDEF AfterConstructionDataModuleNotWorking}
if (Instance is TDataModule) then begin
TDataModule(instance).AfterConstruction;
end;
@ -1466,6 +1466,9 @@ end;
{ =============================================================================
$Log$
Revision 1.119 2005/05/03 16:52:29 mattias
fixed triggering TDataModule, and improved parent search for new designer controls. from Jesus
Revision 1.118 2005/04/20 07:14:00 mattias
moved THintInfo from forms.pp to controls.pp and changed TControlShowHint event from pointer to PHintHinfo