Solved

Creating a multiline title bar for the Panel component

Posted on 2008-06-11
3
2,659 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
ID: 21768441
<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
ID: 21772195
yep, that's it. sweet.
0
 
LVL 4

Expert Comment

by:xPert_Umer
ID: 22257535
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Getting rid of an unwanted URL 5 228
Refresh Image 2 30 945
flex4 : css styles 1 487
export web flash file 11 420
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 do we balance the user experience (UX) with reasonable security measures? It can be done, if you keep these fundamentals in mind.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 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