If you choose to try this, I forgot you need to include the ViewStack's viewMetricsAndPadding in the measurements before setting the parent window's width and height.
Mike On Thu, Sep 4, 2008 at 8:15 AM, Michael Schmalle <[EMAIL PROTECTED]>wrote: > Hi, > > Yes, this seems like the job for a subclass. The problem here is the > ViewStack only measures the selectedChild. > > So there is no possibility of knowing anything about the other children > until the child becomes the selected child. > > On the other hand, if you know you have all of your content loaded in each > tab, I see no reason why you couldn't set creation policy to all. Listen to > creation complete and loop through all the children of the view stack doing > a; > > semi code > > var maxWidth:Number = 0; > var maxHeight:Number = 0; > > var len:int = numChildren; > for (var i:int = 0; i < len; i++) > { > var child:IUIComponent = IUIComponent(getChildAt(i)); > maxWidth = Math.max(child.getExplicitOrMeasuredWidth(), maxWidth); > maxHeight = Math.max(child.getExplicitOrMeasuredHeight(), maxHeight); > } > > var window:Container = Container(parent); > var vm:EdgeMetrics = window.viewMetrics; > > // this takes into account titlebar and borderMetrics of the TitleWindow > window.width = maxWidth + vm.left + vm.right; > window.height = maxHeight + vm.top + vm.bottom; > > That needs to be in a TabNavigator subclass after you know for sure ALL > children have been created. > > I don't know if that will work, but this is where I would start dealing > with the same problem. > > Mike > > > > > On Thu, Sep 4, 2008 at 7:06 AM, Jason Crummack < > [EMAIL PROTECTED]> wrote: > >> Hi, >> >> I have a problem with the display of an options dialog (TitleWindow) >> that contains a TabNavigator and sizing of the underlying tabs. >> >> I've tried combinations of creationPolicy="all" and >> resizeToContent="true" on the navigator and don't seem to be able to get >> the effect i'm after >> what i'd like is for the titlewindow / viewstack to size to the largest >> width and height of all of the children in the stack. Unfortunately I >> can't >> set explicit widths and heights for these panels as all language and >> style details are externally loaded resources so there's also no way of >> telling from style to style / language to language which is the widest / >> tallest child. The closest i get is the dialog resizing to each child >> which seems a little messy. >> >> Any ideas? Guessing i'm probably going to have to subclass TabNavigator >> and/or ViewStack? >> >> Thanks >> >> Jason >> >> > > > > -- > Teoti Graphix, LLC > http://www.teotigraphix.com > > Teoti Graphix Blog > http://www.blog.teotigraphix.com > > You can find more by solving the problem then by 'asking the question'. > -- Teoti Graphix, LLC http://www.teotigraphix.com Teoti Graphix Blog http://www.blog.teotigraphix.com You can find more by solving the problem then by 'asking the question'.