Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2009-11

Component.name = "Owner"

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin

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....

Martin

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'

Reply by email

Mattias Gaertner
to Martin
Show quoted text 12 lines
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'.

Show quoted text 11 lines
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

Reply by email