Clearly I haven't mastered layout and measurement.

I've implemented a custom component which tiles its children in
equal-sized tiles, but also has a state (not a flex state) where one
tile fills the component.

I subclassed Canvas and set the sizes and positions of children in
updateDisplayList. I didn't override measure(), but it works very
nicely, resizing children smoothly as it is resized.

Now, however, I would like to set a minimum width and height for the
tiled view, after which scroll bars appear. The minimum will be
different if the component is in the one-tile-expanded case.


Can I do this without further mods to my component?
Should my updateDisplayList be calling setActualSize rather than
setting x,y,width, height?
Should I have a measure() implementation?
How would it differ from the inherited one?
In a scenario like the following, would I set the minWidth and
minHeight on the parent or child?
Or, to ask another way, do the the scrollpolicy and minimum properties
always belong on the same component?

        <mx:Canvas id="scrollableArea" width="100%" height="100%"
verticalScrollPolicy="auto"
                horizontalScrollPolicy="auto">
                
                <view:TiledCanvas id="tiledView"
                        width="100%" height="100%"      
                >
                </view:TiledCanvas>
        </mx:Canvas>

Thanks.

Reply via email to