Hi Ali,

I'll give it a try tonight.

One of the other difficulties I was having was this:

I wanted to Keep a tab's state when a view is switched.

For example, I have something like:

tabNavigator
---pets
-----dogs
-----cats

---programmers
-----java
-----actionscript
-----php

/tabNavigator

I am currently hiding tabs for dogs, cats, actionscript, etc (all the children). Ideally, I'd like to keep the state of the parent tab up. Perhaps I could wrap those views in a Canvas with an ID, but I wouldn't know how to specify that child within the modelLocator.


Dave



On 6/1/05, Alistair McLeod <[EMAIL PROTECTED]> wrote:
Hi Dave,
 
Have you tried using the resize handler of the TabNavigator, and resizing the tabs at that poing? I'd probably wrap this inside a custom TabNavigator component.
 
Cheers,
 
Ali
 
--
Alistair McLeod
Development Director
iteration::two
[EMAIL PROTECTED]
 
Office:  +44 (0)131 338 6108
 
This e-mail and any associated attachments transmitted with it may contain confidential information and must not be copied, or disclosed, or used by anyone other than the intended recipient(s). If you are not the intended recipient(s) please destroy this e-mail, and any copies of it, immediately.
 
Please also note that while software systems have been used to try to ensure that this e-mail has been swept for viruses, iteration::two do not accept responsibility for any damage or loss caused in respect of any viruses transmitted by the e-mail. Please ensure your own checks are carried out before any attachments are opened.
 
 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of dave buhler
Sent: 31 May 2005 19:19
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] TabNavigator - Hiding Tabs

Hi Alistair,

I'm using Cairngorm .99 and have added about 10 mappings to my ModelLocator.

Of those 10, 5 are views that need 'tab-ability' and 5 should be hidden.

I used the method below, hiding the tab and setting visibility to false. This works, initially.

However, when the stage is resized, the tabnavigator recalculates and repositions the tabs, including the tabs with the width set to 0.

Is there another workaround?
Is there a way to add a Stage.onResize listener in Flex to reset specific tabs within the tabBar to a width of 0?

Dave

On 5/21/05, Alistair McLeod <[EMAIL PROTECTED]> wrote:
Hi Alex,

Try this - I've made the tab visible and also set its width to 0, to force
subsequent tabs to move along to consume the space. tabBar is a private
property of TabNavigator, so I've had to trick the compiler into letting us
access it.


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" >

        <mx:Script>
        <![CDATA[

                private function hideSecondTab() : Void
                {
                        var secondTab = tn["tabBar"].getChildAt( 1 );

                        secondTab.visible = false;
                        secondTab.width = 0;
                }
        ]]>
        </mx:Script>
        <mx:TabNavigator id="tn" width="100%" height="100%" >
                <mx:HBox label="Tab 1" width="100%" height="100%" />
                <mx:HBox label="Tab 2" width="100%" height="100%" />
                <mx:HBox label="Tab 3" width="100%" height="100%" />
        </mx:TabNavigator>

        <mx:Button label="Hide Second Tab" click="hideSecondTab();" />

</mx:Application>


--
Alistair McLeod
Development Director
iteration::two
[EMAIL PROTECTED]

Office:  +44 (0)131 338 6108

This e-mail and any associated attachments transmitted with it may contain
confidential information and must not be copied, or disclosed, or used by
anyone other than the intended recipient(s). If you are not the intended
recipient(s) please destroy this e-mail, and any copies of it, immediately.

Please also note that while software systems have been used to try to ensure
that this e-mail has been swept for viruses, iteration::two do not accept
responsibility for any damage or loss caused in respect of any viruses
transmitted by the e-mail. Please ensure your own checks are carried out
before any attachments are opened.


-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
Behalf Of gevgelija50
Sent: 20 May 2005 20:16
To: flexcoders@yahoogroups.com
Subject: [flexcoders] TabNavigator - Hiding Tabs

I am trying to hide certain tabs from a Tab Navigator based on some
criteria. If I follow this approach: tabnav[0].visible = false; the actual
Tab is still visible but the children within that tab are invisible.

How can I hide the tab button itself?

Thanks,
Alex





Yahoo! Groups Links








Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/






Yahoo! Groups Links



Yahoo! Groups Links

Reply via email to