Michael Schmalle wrote:
>> Add things to rawChildren and setStyles on contentPane.
>
> What do you mean by this?
Alright I concede now that after reading what she is trying to do it 
will not be as simple as I described. My experience has been with 
creating containers from DisplayObjects of extending and hacking the 
Container itself. I have not done what she is trying to do, I have not 
tried to hack a Panel in this way. And to be frank I don't understand 
why.  But here is my revised suggestion.

Create a component that extends Display Object, add the Panel to it and 
the container that you want to have the children. You'll have to use the 
top, left, bottom and right properties on each of them to control the 
sizing and whatnot. Then override addChild and addChildAt to add any 
future components to the "contentPane" you created.  This should work 
and will simulate what Containers already do and you don't have to worry 
about all the numChildren and other "tricky" stuff related to containers.

Claudia, What is the purpose/goal of this?  It doesn't make sense why 
you wouldn't just add the container to the Panel and then after that 
point add items to the container.

Paul

>
> If you are creating a composite child, there will be no contentPane 
> created
> if you resize it in the raw children's list.
>
> I would love to see your implementation of 2 or 3 methods, do you 
> override
> numChildren also?
No... because I extend DisplayObject.
>
> Peace, Mike
>
>
> On 4/27/07, Paul J DeCoursey <[EMAIL PROTECTED]> wrote:
>>
>>   I'm sorry, but it's not tricky or cumbersome... there are like 2 
>> maybe 3
>>
>> functions to override. It's very easy to do. Really what Claudia will
>> want to do is use the built in code in Container. Add things to
>> rawChildren and setStyles on contentPane.
>>
>> Paul
>>
>>
>> Manish Jethani wrote:
>> > You'll have to override the whole child management API.
>> > mx.core.Container already does this for the case where it has
>> > scrollbars. See the internal contentPane property and how it's
>> > implemented. It's tricky and cumbersome.
>> >
>> > On 4/27/07, Claudia Barnal <[EMAIL PROTECTED] 
>> <barnaclau%40gmail.com>>
>> wrote:
>> >
>> >> Hi,
>> >>
>> >> What would I have to do to make the child of a Panel be the recipient
>> >> of any children added to that Panel, like below?
>> >>
>> >> For example, below if my custom container creates another container
>> >> (let's call it the xxx container) in the createChildren() method, how
>> >> can I make sure any children added to the parent container are added
>> >> to the xxx container?
>> >>
>> >> I guess I have to override the actual addChild() method, to bypass 
>> the
>> >> normal flow and adding the newly added children to the xxx container,
>> >> but how would that work out?
>> >>
>> >> <blah:CustomContainer>
>> >> <mx:HBox>
>> >> </mx:HBox>
>> >> <blah:CustomContainer>
>> >>
>> >> Any comments or ideas?
>> >>
>> >> Thanks,
>> >> Claudia
>> >>
>> >>
>> >>
>> >> Yahoo! Groups Links
>> >>
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>>
>>  
>>
>
>
>

Reply via email to