0 Replies Latest reply on Sep 10, 2008 9:11 AM by AJC5327

    Accessing Close button in TitleWindow

      Hi all,
      I have a situation where I'm adding buttons to a TitleWindow chrome. They co-exist with the close button provided by the panel. I create classes for my button images and then I size the buttons to fit the image.

      I also set the styles for the panel-provided close button with classes. My goal was to have all the buttons look & feel the same.

      Excerpt from application mxmxl ...
      TitleWindow {
      backgroundColor: #333333;
      closeButtonDisabledSkin: Embed("assets/close.png");
      closeButtonDownSkin: Embed("assets/closeDown.png");
      closeButtonOverSkin: Embed("assets/closeDown.png");
      closeButtonUpSkin: Embed("assets/closeUp.png");

      <v:ResizeWindow id="testResizeWindow"
      title="Resize Window"
      close="popUp('Close button clicked')">

      Excerpt from my ResizeWindow class ...
      override protected function createChildren():void{
      if(btnMinimize == null){
      btnMinimize = new Button();
      var btnMinimizeImageObj:BitmapAsset = new btnMinimizeUpSkin() as BitmapAsset;
      btnMinimize.width = btnMinimizeImageObj.width;
      btnMinimize.height = btnMinimizeImageObj.height;

      btnMinimize.setStyle("upSkin", btnMinimizeUpSkin);
      btnMinimize.setStyle("overSkin", btnMinimizeDownSkin);
      btnMinimize.setStyle("downSkin", btnMinimizeDownSkin);
      btnMinimize.addEventListener(MouseEvent.CLICK, minimizeHandler);

      1) For the buttons I add (e.g. btnMinimize) ... if I don't explicitly set the width and height, they default to 0 and button is invisible. Button class says it should size in accordance with the image. Is this normal behavior?
      2) Along the lines of #1 above, if I just create btnMinimize and give it a text label (no image), the button sizes to a width and height of 0. I have to set the width and height for it to appear? Is this normal behavior?
      3) I can't include a screen clip here but the close button succesfully uses the images I provide but it is larger than the other buttons (and the image is distorted). Can I set the height and width of the close button to match the image I'm providing (or conversely can I get the height and width of the close button so I can size my buttons the same)?

      Spent a few days and I'm getting nowhere ...

      thx in advance for any help ...