Off the top of my head:
 
<mx:Canvas>
    <mx:Button x="115" y="0">
    <mx:Panel x="0"y="0">
    </mx:Panel>
</mx:Canvas>
 
By putting everything in the Canvas you can place the items anywhere you want. In this case you can place the Button over the title bar of the Panel.
 
Jimmy Gianninas - Developer
Optimal Payments Inc.
 


From: Seth Voltz [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 03, 2005 5:47 AM
To: Flex Coders
Subject: [flexcoders] Attempting to add a button to Panel titlebar

Fellow Flexcoders,

So I have been trying to place a button in the titlebar of one of my panels and started digging around. I remembered Jesse had put up an example of a mix-in class ( http://www.jessewarden.com/archives/2005/01/collapseable_pa.html ) for doing just that. I dug through the code and have had no luck. I have included theactionscript from my test file at the end of this message.

so my questions are:

1) Jesse, what voodoo do you do to get that to work? ;)
2) Everyone, is there a different way I can do this? Is Jesse's way the most efficient / elegant?

Thanks,
Seth

Code:

myPanel.mxml (root element is <mx:Panel /> with the following in a script tag, not including includes)

import mx.utils.*;
import de.richinternet.utils.Dumper;

private var menu_pb : Button;

public function initFunk ( ) {
Dumper.dump ( "Init..." );
_initMenuButton ( this ); // Not sure why I have to do this, but I don't got compile errors on menu_pb with this.
}

static private function _initMenuButton ( obj ) {
Dumper.dump ( "Init 2..." );

obj.>
obj.createClassObject ( Button, "menu_pb", obj.getNextHighestDepth ( ));
obj.menu_pb.label = ">";
obj.menu_pb.setSize ( 22, 22 );
obj.menu_pb.addEventListener ( "click", Delegate.create ( obj, obj.onMenuButton ));
}

private function onMenuButton ( ) {
Dumper.dump ( "Trace: fileShare.onMenuButton()" );
}

static private function _sizeOverload ( obj ) {
Dumper.dump ( "Size 2..." );
obj.super.size ( );
obj.menu_pb.move ( obj.width - obj.menu_pb.width - 8, 4 );
}

function size ( ) : Void {
Dumper.dump ( "Size..." );
super.size ( );
_sizeOverload ( this );
}

/* All dumps to the tracer are accounted for and in the expected order... */

AVIS IMPORTANTWARNING

Les informations contenues dans le present document etses pieces jointes sont strictement confidentielles et reservees a l'usagede la (des) personne(s) a qui il est adresse. Si vous n'etes pas le destinataire, soyez avise que toute divulgation, distribution, copie, ou autre utilisation de ces informations est strictement prohibee. Si vous avez recu ce document par erreur, veuillez s'il vous plait communiquer immediatement avec l'expediteur et detruire ce document sans en faire de copie sous quelque forme.

The information contained in this document and attachments is confidential and intended only for the person(s) named above. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution, or any other use of the information isstrictly prohibited. If you have received this document by mistake, pleasenotify the sender immediately and destroy this document and attachments without making any copy of any kind.


Reply via email to