3 Replies Latest reply on Jul 6, 2006 2:21 AM by ElsaB

    Minimise and maximise buttons in Flex Store


      I'm writing a Flex app and would like to implement something similar to the Flex Store's minimise and maximise buttons. I know how to add an icon using titleIcon in the Panel properties but I would like to add two buttons to the panel header. Can anyone give me any ideas on how to add these buttons to the header of the panel?

      Thanks in advance,

        • 1. Re: Minimise and maximise buttons in Flex Store
          inlineblue Level 1
          If you want to be able to add arbitrary UI bits on top of a Panel, my suggestion is to put the Panel inside a Canvas and then lay stuff on top of the Panel using the Canvas.
          • 2. Re: Minimise and maximise buttons in Flex Store
            Flex harUI Adobe Employee
            The source for the Panel should be in the files you installed. I don't remember where they are off-hand, but they are there so you can see how we did it and copy it. Look for flexstore.mxml, the other Panels are mxml files in the same directory.
            • 3. Re: Minimise and maximise buttons in Flex Store

              I'm trying to do something similar and I'm looking at the code from Flexstore to work out what is going on.

              The problem I'm having is I keep getting:

              "Access of undefined property titleBar"
              "Access of undefined property statusTextField"
              "Access of undefined property titelTextField"

              Is there something obvious that I'm missing? I'm really new to Flex and it could be something obvious.

              I wondered if it was something to do with the changes made for the final release, but when I downloaded the Flexstore source I got it to work locally.

              Here is the code I'm using that is sat inside a panel component:


              import mx.core.IUIComponent;
              import mx.effects.Move;
              import mx.containers.Panel;

              private var titleButtons:CatalogTitleButtons;

              override protected function createChildren():void
              titleButtons = new CatalogTitleButtons();


              override protected function layoutChrome(unscaledWidth:Number, unscaledHeight:Number):void
              super.layoutChrome(unscaledWidth, unscaledHeight);
              titleButtons.width = unscaledWidth / 2;
              titleButtons.height = titleButtons.measuredHeight;
              titleButtons.move(statusTextField.x - titleButtons.width, titleTextField.y);

              Any advice would be great.