I ran into a similar situation a while ago where I needed to add stuff to the panel's title bar.  While it's possible to use a Canvas to lay stuff on top of a Panel, this doesn't work if you're trying to create a re-useable custom Panel because the resulting component is a subclass of Canvas, not Panel.  If you try to use it in MXML, you'll be adding children to the enclosing Canvas, which is not what you want.

What I ended up doing was subclassing Panel via AS only and then overriding the createChildren() and updateDisplayList() methods.  It just so happened that the Panel's title bar object, titleBar, was declared public so I was able to accessi it and add children to it.  I've no idea if this still works in the Beta as I've yet to try it.

Is there a better solution?

On 2/3/06, Alex Uhlmann <[EMAIL PROTECTED]> wrote:
You could use a Canvas tag to lay all kinds of things on top of a Panel. ie.
 
<mx:Canvas>
 
    <mx:Panel />
        ....
    </mx:Panel>
 
    <yourComps:CustomPanelHeader
        x="10" y="10" />
 
</mx:Canvas>
 
Best,
Alex
 
Alex Uhlmann
Technical Consultant (Rich Internet Applications)
Adobe Consulting
Westpoint, 4 Redheughs Rigg, South Gyle, Edinburgh, EH12 9DQ, UK
p: +44 (0) 131 338 6969
m: +44 (0) 7917 428 951 
[EMAIL PROTECTED]

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of gunnar a reinseth
Sent: 03 February 2006 12:30
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Closable Panel? (flex2)

I know that mx.controls.Panel contains a 'closeButton' which is utilised in the subclass TitleWindow. I really would like to have this close button on panels as well, so i guess i have to subclass Panel to achieve this. However, I have no clue of how to make this button visible and position it in the title area. Could anybody please help with this?

--
gunnar


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to