Hi, i did something like that with the Panel Class, let me tell you
what I did...
I extend the Panel class an add a few instance variables (the image
for the controls)
mx_internal var minimizeButton:Image;
mx_internal var maximizeButton:Image;
mx_internal var mediumButton:Image;
I use Images because i dont want to have issues with skinning
buttons..then i override a few methods....here is a sample (is just a
portion)...
override protected function createChildren():void
{
super.createChildren();//To draw the panel default childrens
if (!minimizeButton) //I did the same for the other buttons
{
minimizeButton = new Image();
minimizeButton.automationComposite = this;
minimizeButton.styleName = this;
//I pass the source as a style...so you need to declare it as metadata
//( [Style(name="minimizedIcon", type="String", inherit="no")] ) after
// the imports declaration
minimizeButton.source = getStyle("minimizedIcon");
minimizeButton.focusEnabled = false;
minimizeButton.visible = true;
minimizeButton.enabled = enabled;
//I define a callback function to perform the animation
minimizeButton.addEventListener(MouseEvent.CLICK,
minimizeButton_clickHandler);
titleBar.addChild(minimizeButton);
}
}
override protected function layoutChrome(unscaledWidth:Number,
unscaledHeight:Number):void
{
super.layoutChrome(unscaledWidth, unscaledHeight);
var bm:EdgeMetrics = borderMetrics;
var x:Number = bm.left;
var y:Number = bm.top;
var headerHeight:Number = getHeaderHeight();
if (headerHeight > 0 && height >= headerHeight)
{
//basically, this section puts the buttons on the right corner of the
panel bar....
minimizeButton.setActualSize(
minimizeButton.getExplicitOrMeasuredWidth(),
minimizeButton.getExplicitOrMeasuredHeight());
minimizeButton.move(
unscaledWidth - x - bm.right -
35 -
minimizeButton.getExplicitOrMeasuredWidth(),
(headerHeight -
minimizeButton.getExplicitOrMeasuredHeight()) / 2);
//Put the other buttons here....
}
var leftOffset:Number = 10;
var rightOffset:Number = 10;
var h:Number;
var offset:Number;
}
}
And finally you mas implements the callback functions...
private function minimizeButton_clickHandler(event:MouseEvent):void
{
var resize:Resize = new Resize(this);
resize.heightTo = getHeaderHeight();
resize.duration = 250;
resize.play();
}
the you can use it like...
<controls:AdvancedPanel title="Title" width="100%" height="100%"
dropShadowEnabled="true"
paddingTop="2" paddingBottom="2" paddingLeft="2"
paddingRight="2"
minimizedIcon="@Embed('/assets/image/miniIcon.gif')"
>
I hope it helps you
--- In [email protected], Jesús Iglesias <[EMAIL PROTECTED]> wrote:
>
> Nobody has made somthing similar?
>
> -----Mensaje original-----
> De: Jesús Iglesias [mailto:[EMAIL PROTECTED]
> Enviado el: miércoles, 07 de junio de 2006 17:29
> Para: '[email protected]'
> Asunto: resizable, maximize and minimize TileWindow
>
>
> Hi all,
>
> Have any of you made a TileWindow component with resize, maximize and
> minimize controls?
> Can you give me any idea on how to do it?
>
> Thanks.
>
> Jesús Iglesias
> Alvento Soluciones Móviles
> Poeta Querol, 5 - 2
> 46002 Valencia (España)
> [tel]: (+34) 96.353.02.15
> [fax]: (+34) 96.353.08.09
> [e-mail]: <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
> [web]: <http://www.alvento.com/> www.alvento.com
>
> Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
> contiene información de carácter confidencial exclusivamente dirigida a
> su destinatario o destinatarios y propiedad de Alvento Soluciones S.A.
> Queda prohibida su divulgación, copia o distribución a terceros sin la
> previa autorización escrita de Alvento Soluciones S.A., en virtud de la
> legislación vigente. En el caso de haber recibido este correo
> electrónico por error, se ruega notificar inmediatamente esta
> circunstancia mediante reenvío a la dirección electrónica del remitente
> y la destrucción del mismo.
>
>
> The information in this e-mail and in any attachments is classified as
> Alvento Soluciones S.A. Confidential and Proprietary Information and
> solely for the attention and use of the named addressee(s). You are
> hereby notified that any dissemination, distribution or copy of this
> communication is prohibited without the prior written consent of Alvento
> Soluciones S.A. and it is strictly prohibited by law. If you have
> received this communication by error, please, notify the sender by
> replying e-mail.
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Everything you need is one click away. Make Yahoo! your home page now.
http://us.click.yahoo.com/AHchtC/4FxNAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/