It’s always a joy when you need something and after writing a few lines of code, you have it. Such is the beauty of nice extendable components and the Flex architecture.
Today I needed a panel which had a button in the top right corner of the header. Where the ’status’ text is normally is. I wanted to put a ’save’ button there. One problem, the mx.containers.Panel component does not have a button in the header.
Solution. Make a new component which extends all the functions of the Panel and stick a button in the top corner where I want.
Click here to see a demo
Click here to view the source
My new ButtonPanel component extends Panel and adds 2 new properties and 1 event.
Properties
buttonLabel : String – Defines the label for the button in the top corner
buttonPadding : Number – Defines how much padding to provide in the header
Event
buttonClick : Event – Dispatched when the button is clicked
Cool, just what I needed.
This is excellent I have been looking for this capability
Nice, but focus rect is off.
Hit tab and see what happens…
Cool stuff. Nice and simple. Just what I needed. Thanx!