7 Replies Latest reply on Dec 6, 2007 4:38 PM by Peter Flynn (Adobe)

    FB3 Designer not working correctly

      This is a FB2 project that I've converted to an FB3 project. This issue is not seen in FB2.

      I'm building a control that is a descendant of mx:Canvas

      In the designer I don't set height and width of the Canvas. I have various controls in the canvas (at design time).
      One of these controls <mx:image> is way off to the right. When in the designer, the containing canvas seems to be pretty small (shows as a white are with scales on the top and left). However, this area does not encompass the <mx:image> control that is really contained within the canvas. I don't even see it. As in there is absolutely no indication that there is anything outside of the boundaries of the canvas.

      If I intentionally set the width to a large amount, I'll see the <mx:image> control. But this is not what I want to do and nor did I have to do this in FB2.

      So is this a bug or as designed? I certainly hope this is not as designed.
        • 1. Re: FB3 Designer not working correctly
          Peter Flynn (Adobe) Adobe Employee
          Hi Shiv,

          In your custom component's definition, do you set width and height? This will lock the component to that size regardless of its children. If you don't specify width and height, the component should auto-size to fit all of its children.

          When children don't fit within a Canvas's current size, it will show scrollbars by default -- but only at runtime, not at design time.

          I hope that helps. If you're still having trouble, please post a brief code snippet illustrating the problem.

          - Peter
          • 2. Re: FB3 Designer not working correctly
            Shiv_Kumar Level 1

            I don't set the width and height in the component. This is intentional so that users of the component can set it.

            The image is contained within the Canvas but the canvas does not show it encapsulated within itself in the designer. In oterwords as you say, the conponent does not auto-size to fit all it's children. At leat this is not the case at design time or is diffinately not visible/obvious at design time.

            I can't even see that there is an image control anywhere in the designer. No scroll bars, or any indication that it's even there. At run time the behavior is the same (or as expected), but at design time it's not the same as FB2. In my opinion (for this case) FB2 does the right thing while FB3 does not, making it impossible to use the designer for such cases.
            • 3. FB3 Designer not working correctly
              sharonma Level 1
              Hi Shiv,

              I just tried with the following in our lastest FB 3 build:
              Create a new MXML Component file based on Canvas with no width and height. When this file is open in Design view, its design area is "400 x 300" by default.

              If I add an image to the file that's outside the current design area (for example in the attached code below.)

              Then this image is "invisible" in design view because it's outside the design area.

              If I change the design area (from the design view toolbar) to either "Fit to content" or a bigger custom size, then the image is now visible. FB would remember the previous design area setting after closing and reopening the file. That way you don't have to change the ACTUAL width/height of the Canvas but you can work with your controls.

              • 4. Re: FB3 Designer not working correctly
                Shiv_Kumar Level 1

                Yes this (Fit to Content) helps in being able to see the contents of the canvas. Maybe the default for components should be fit to content? It doesn't make sense to size the design area to a specific size for controls.
                • 5. Re: FB3 Designer not working correctly
                  sharonma Level 1
                  Hi Shiv,

                  It'd be great if you can log these enhancement requests in our public bug system: http://bugs.adobe.com/flex so we'll be able to keep track of (and maybe implement) them. :)

                  • 6. Re: FB3 Designer not working correctly
                    I'm not sure if its a bug, feature, or just a fact of life, but I would love a way to switch a component, at runtime, from manually sized (<mx:box width="100" box.height="100">) to auto-sized based on the size of its children. Since this is the controls' behavior until such time as a fixed size is set, it should be able to revert to this. Perhaps an autoSize property, or better, separate autoSizeX and and autoSizeY properties.


                    • 7. Re: FB3 Designer not working correctly
                      Peter Flynn (Adobe) Adobe Employee

                      Try setting explicitWidth and/or explicitHeight to NaN.

                      - Peter