includeInLayout is a flag on UIComponent and therefore Canvas and just about everything as to whether its parent container should include it in its layout algorithm, which is why only HBox, VBox, etc will actuall examine the flag on its children.
Navigators do not examine this flag, and use visibility to hide the unselected child, so there's no easy way to hide things from the navigators we ship. SuperTabNavigator does, I believe, so check it out. ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Freiman Sent: Friday, October 19, 2007 8:00 AM To: [email protected] Subject: Re: [flexcoders] TabNavigator and includeInlayout Where does it say this in the docs? Does it mean that these the includeInLayout property is only heeded for children of those types of containers? Because that would make more sense. - Dan Freiman On 10/19/07, johantrax <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: I'm having some trouble understanding the 'why' of the restriction on the includeInLayout-property As Stated in the livedocs, includeInLayout only applies to: * Box, or any of its subclasses: HBox, VBox, DividedBox, HDividedBox, VdividedBox, Grid, GridItem, GridRow, ControlBar, and ApplicationControlBar, * Form * Tile and its subclass, Legend * ToolBar But then again, includeInLayout is a property of UIComponent. Why aren't we allowed to hide a Canvas, ... ? Or even better, when using a Box inside a TabNavigator (most likely within any viewStack) this setting just gets ignored. I do realise I could use addChild and RemoveChild for my tab inside the navigator. However, consider the following: A TabNavigator, a buttonbar with a button for each tab. A click on a button changes includeInLayout and visible properties for the corresponding tab. What I expect is, that on clicking a button, the corresponding tab is 'removed' from the navigator. When making the tab visible again, it shows up at the same position as before. So why don't use removeChildAt() ? Say I have 4 tabs, and I removed tab2. Next I want to remove the tab originally at index3, but now at index2. Removing the third tab, ends in removing the tab that was originally 4th... And why don't use addChildAt() ? State I somehow managed to remove the tabs 2-4 of a navigator of 5 tabs. Now I want to show(re-add) the original 4th tab. This tab should be set 'in place' again. However when using addChildAt(3), you'll get an indexOutOfBoundsException, since only tab 1 and 5 are present. What leaves you a tabnavigator with numChildren of 2... Any thought on solving this one? --Johan

