So normally when you place a TabNavigator in a container other than a Canvas you wouldn't run into this issue because everything would grow accordingly.  Since you're inside a Canvas you get to see a little weirdness in how the TabNavigator does its sizing.  The default rule is for the Navigator to size according to the max of the size of its current child or the minimum width needed to display all the tabs.  The issue you have here is that you explicitly sized the tabs and we didn't take that into account.  So I'll file a bug on that since it seems like the right thing to do.  In the meantime, you should simply explicitly size the TabNavigator by setting width=300 (or something a little less to make it look right with 3 tabs).

 

We're going to be working on issues like this in the upcoming releases.

 

Matt

 

-----Original Message-----
From: bobpardoe1959 [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 04, 2004 5:03 AM
To: [email protected]
Subject: [flexcoders] tab contents and tab header fixed size problem

 

The mxml file below shows that when flex sizes components it is not
co-ordinating within itself, so that the titles of a tab container
are being set at a fixed size, but the tab contents are not looking
to see if the sum of tabs are bigger than the container

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
styleName="Plain" backgroundColor="0xFFFFFF" >
      <mx:Script>
      <![CDATA[
            function setMode(Mode:String)
            {
           
            }
      ]]>
                 
      </mx:Script>
     
    <mx:Style source="MyStylesheet.css"/>
      <mx:Panel id="BasePanel" label="{BasePanel.title}"
title="Order Maintenance" headerHeight = "22" marginTop="2"
marginBottom="2" marginLeft="2" marginRight="2">
   
      <mx:HDividedBox borderStyle="none" id="divider"
marginLeft="2" marginTop="2" marginRight="2" marginBottom="2" >
   
        <mx:Accordion borderStyle="solid" historyManagement
= "false" widthFlex="1" minWidth="50" maxWidth="150">
            <mx:VBox label="Mode">
              <mx:Link label="Create" click="setMode('Create')"/>
              <mx:Link label="Amend" click="setMode('Amend')"/>
              <mx:Link label="Delete" click="setMode('Delete')"/>
              <mx:Link label="Enquire" click="setMode
('Enquire')"/>
            </mx:VBox>
            <mx:VBox label="Associated Tasks">
              <mx:Label text="This is Panel 2"/>
            </mx:VBox>
            <mx:VBox label="Help">
              <mx:Label text="This is Panel 3"/>
            </mx:VBox>
        </mx:Accordion>
       
      <mx:Canvas >
        <mx:TabNavigator x="500" y="100" tabWidth="100" >
          <mx:Form label="Address1" >
              <mx:FormItem label="Road" required="true" >
                  <mx:TextInput id="txtRoad_1" height="20"
width="50"/>
              </mx:FormItem>
              <mx:FormItem label="Town" required="true" >
                  <mx:TextInput id="txtTown_1" height="20"
width="50"/>
              </mx:FormItem>
              <mx:FormItem label="County" required="true" >
                  <mx:TextInput id="txtCounty_1" height="20"
width="50"/>
              </mx:FormItem>
              <mx:FormItem label="Post Code" required="true" >
                  <mx:TextInput id="txtPCode_1" height="20"
width="50"/>
              </mx:FormItem>
        </mx:Form>
          <mx:Form label="Address2" >
              <mx:FormItem label="Road" required="true" >
                  <mx:TextInput id="txtRoad_2" height="20"
width="50"/>
              </mx:FormItem>
              <mx:FormItem label="Town" required="true" >
                  <mx:TextInput id="txtTown_2" height="20"
width="50"/>
              </mx:FormItem>
              <mx:FormItem label="County" required="true" >
                  <mx:TextInput id="txtCounty_2" height="20"
width="50"/>
              </mx:FormItem>
              <mx:FormItem label="Post Code" required="true" >
                  <mx:TextInput id="txtPCode_2" height="20"
width="50"/>
              </mx:FormItem>
        </mx:Form>
          <mx:Form label="Address3" >
              <mx:FormItem label="Road" required="true" >
                  <mx:TextInput id="txtRoad_3" height="20"
width="50"/>
              </mx:FormItem>
              <mx:FormItem label="Town" required="true" >
                  <mx:TextInput id="txtTown_3" height="20"
width="50"/>
              </mx:FormItem>
              <mx:FormItem label="County" required="true" >
                  <mx:TextInput id="txtCounty_3" height="20"
width="50"/>
              </mx:FormItem>
              <mx:FormItem label="Post Code" required="true" >
                  <mx:TextInput id="txtPCode_3" height="20"
width="50"/>
              </mx:FormItem>
        </mx:Form>
      </mx:TabNavigator>
      </mx:Canvas>
</mx:HDividedBox>
      <mx:ControlBar marginTop="2" marginBottom="2" marginLeft="2"
marginRight="2">
        <!-- Use Spacer to push Button control to the right. -->
        <mx:Spacer widthFlex="1" />
        <mx:Button label="Update" click="" />
      </mx:ControlBar>
</mx:Panel>
</mx:Application>

Also a property or method of the tabheaders that sized itself based
on the contents of the tab would be useful.

Any fixes or workarounds appreciated.

BOb


Reply via email to