[fpc-devel] Component.name = "Owner"

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Nov 8 01:00:29 CET 2009


On Sat, 07 Nov 2009 21:52:08 +0000
Martin <lazarus at mfriebe.de> wrote:

> I put 2 componets on my Form
> 
> A button named "foo2
> a label named "Owner"  (case sensitive)
> 
> Now I try to set an anchorside of the Button to the Form. But because
> of the Form is the Buttons Owner this is streamed as
>  object Button1: TButton
>     AnchorSideRight.Control = Owner
> 
> And when the form is loaded, the anchorside is set to the Label, and
> not the Form....

That is correct. I added a check, so that lazarus does not allow naming
a component 'Owner'.


> rtl\objpas\classes\writer.inc
> procedure TWriter.WriteProperty(Instance: TPersistent; PropInfo:
> Pointer); ...
>   tkClass:
> .... (line 1076)
>               { Determine the correct name of the component this 
> property contains }
>               if Component.Owner = LookupRoot then
>                 Name := Component.Name
>               else if Component = LookupRoot then
>                 Name := 'Owner'


Mattias



More information about the fpc-devel mailing list