• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2705
  • Last Modified:

Creating a multiline title bar for the Panel component

Howdy,

Can anyone point me in the right direction for creating a multi-line title bar for the Panel component in Flex 3?  I know I'll have to subclass it, etc.  But I could use some pointers as to where to start.  Any help would be appreciated.
0
asaivan
Asked:
asaivan
1 Solution
 
Gary BenadeCommented:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*">
      <local:MultiLineHdrPanel title="This is a long title that should wrap to 2 lines" width="682" height="368"/>
</mx:Application>

save code below as MultiLineHdrPanel.as
package
{
	import mx.containers.Panel;
	import mx.controls.Text;
 
	public class MultiLineHdrPanel extends Panel
	{
		private var multiLineHdr:Text;
		public function MultiLineHdrPanel()
		{			
			super();			
		}
		override protected function createChildren():void
        {
            super.createChildren();
            multiLineHdr = new Text();
            multiLineHdr.width = 150;
            multiLineHdr.height = 30;            
            this.titleBar.addChild( multiLineHdr);
   			this.setStyle("headerHeight", 38);            
        }
        override protected function layoutChrome(unscaledWidth:Number, unscaledHeight:Number):void
        {
        	super.layoutChrome(unscaledWidth, unscaledHeight);
        	this.titleTextField.visible = false;            
        	multiLineHdr.text = this.title;
            multiLineHdr.move( 4, 4);
        }		
		
	}
}

Open in new window

0
 
asaivanAuthor Commented:
yep, that's it. sweet.
0
 
xPert_UmerCommented:
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now