Julio,
Olhando diretamente no código fonte da Classe Panel, no método
createChildren o botão fechar é inserido da seguinte forma:

// Create the closeButton as a child of the titleBar.
        if (!closeButton)
        {
            closeButton = new Button();
            closeButton.styleName = new StyleProxy(this,
closeButtonStyleFilters);

            closeButton.upSkinName = "closeButtonUpSkin";
            closeButton.overSkinName = "closeButtonOverSkin";
            closeButton.downSkinName = "closeButtonDownSkin";
            closeButton.disabledSkinName = "closeButtonDisabledSkin";
            closeButton.skinName = "closeButtonSkin";
            closeButton.explicitWidth = closeButton.explicitHeight = 16;

            closeButton.focusEnabled = false;
            closeButton.visible = false;
            closeButton.enabled = enabled;

            closeButton.addEventListener(MouseEvent.CLICK,
                                          closeButton_clickHandler);

            // Add the close button on top of the title/status.
            titleBar.addChild(closeButton);
            closeButton.owner = this;
        }
    }

Sobrescrevendo o este método eu consigo inserir um componente utilizando
titleBar.addChild. No entanto o meu único problema é na hora de posicionar,
pois o componente inserido sempre fica em cima dos outros.

2009/3/24 Julio Carneiro <[email protected]>

>
> Daniel,
>
> O addChild() vai inserir o componente (botão no teu caso) dentro do
> corpo do Panel. Para inserir/modificar algo na borda ou na titleBar vc
> tem que usar rawChildren.addChild().
> E vc possivemente terá que sobrescrever os métodos measure() e
> validateDisplayList() tb para poder posicionar corretamente teu botão.
>
> Olha aqui a documentação do rawChildren:
>
> A container typically contains child components, which can be
> enumerated using the Container.getChildAt() method and
> Container.numChildren property. In addition, the container may contain
> style elements and skins, such as the border and background. Flash
> Player and AIR do not draw any distinction between child components
> and skins. They are all accessible using the player's getChildAt()
> method and numChildren property. However, the Container class
> overrides the getChildAt() method and numChildren property (and
> several other methods) to create the illusion that the container's
> children are the only child components.
>
> If you need to access all of the children of the container (both the
> content children and the skins), then use the methods and properties
> on the rawChildren property instead of the regular Container methods.
> For example, use the Container.rawChildren.getChildAt()) method.
> However, if a container creates a ContentPane Sprite object for its
> children, the rawChildren property value only counts the ContentPane,
> not the container's children. It is not always possible to determine
> when a container will have a ContentPane.
>
> Note:If you call the addChild or addChildAtmethod of the rawChildren
> object, set tabEnabled = false on the component that you have added.
> Doing so prevents users from tabbing to the visual-only component that
> you have added.
>
>
> julio
>
> On Mar 23, 7:34 pm, Daniel Rodrigues da Cunha Frank
> <[email protected]> wrote:
> > Boa noite amigos,
> >
> > Estou querendo posicionar um componente na barra de título de uma Panel,
> > este componente deve ficar entre o botão fechar e o texto de status.
> > Inseri o componente sobrescrevendo o método createChildren do Panel, no
> > entanto não consigo posicioná-lo exatamente onde desejo.
> > Desde já agradeço.
> >
> > Att.,
> >
> > --
> > Daniel R.C.Frank
> > Análise e Programação
> >
>


-- 
Daniel R.C.Frank
Análise e Programação

--~--~---------~--~----~------------~-------~--~----~
Você recebeu esta mensagem porque está inscrito na lista "flexdev"
Para enviar uma mensagem, envie um e-mail para [email protected]
Para sair da lista, envie um email em branco para 
[email protected]
Mais opções estão disponíveis em http://groups.google.com/group/flexdev
-~----------~----~----~----~------~----~------~--~---

Responder a