Solved

Creating a multiline title bar for the Panel component

Posted on 2008-06-11
3
2,641 Views
Last Modified: 2008-06-12
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
Comment
Question by:asaivan
3 Comments
 
LVL 19

Accepted Solution

by:
Gary Benade earned 500 total points
Comment Utility
<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
 
LVL 9

Author Comment

by:asaivan
Comment Utility
yep, that's it. sweet.
0
 
LVL 4

Expert Comment

by:xPert_Umer
Comment Utility
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now