4 Replies Latest reply on Aug 3, 2011 9:27 AM by GeoffreyMartin

    Returning to layout tab...



      Returning to layout tab...



      I was wondering if there is a way to return to a specific Tab in a tab panel.  I have containers of screenshots set up in little boxes for entry but you press a little button next to it and it takes you to a layout with a container that is blown up, so you can better see the data. The script to do it sets a global variable ($$layout) to the layout number of the layout you're in, then takes you to the layout of the blown up container.  Once in that container, you want to go back to the entry layout you were in and press a button there that takes you to layout number $$layout.  Right now, that takes you back to the layout with the front tab loaded (there are only 4 tabs).  Thanks in advance for anyhelp you can offer.

        • 1. Re: Returning to layout tab...

          Use the Inspector's name box to give each tab an object name. Your script that saves the layout number can also save the tab name in a similar variable. When you return to the layout, use go to object to go to the tab's object name and this will return you to the same tab that was selected when you switched to the other layout to view the enlarged image.

          • 2. Re: Returning to layout tab...

            So I set the object names of the tabs in the inspector (in the Name field at the top of the position tab in the inspector?).  I create the variable $$tab = Get (ActiveLayoutObjectName).  I press the button to get to the layout with the enlarged image.  I press the button (script) in the other window to return and I get back to the front tab.  The script to return uses Goto Layout -> $$layout, and Goto Object -> $$tab and then the $$ variables are set to 0.  It's not working. 

            • 3. Re: Returning to layout tab...

              You've used the correct box in the inspector to set object names. In Layout mode, you should see the name change as you click different tabs in the control.

              I'm afraid that you'll need to use something a bit more sophisticated to store the current tab's object name into the variable.

              You may need to use something like this:

              Set variable [$$Tab ; Value:
                 Case ( GetLayoutObjectAttribute ( "Tab1ObjectName" ; "IsFrontTabPanel" ) ; "Tab1ObjectName" ;
                           GetLayoutObjectAttribute ("Tab2ObjectName" ; "IsFrontTabPanel" ) ; "Tab2ObjectName" ;
                           //and so on for each tab in the control
                          ) ]

              Edit Note: corrected typo pointed out in following post...

              • 4. Re: Returning to layout tab...

                This worked very well, thank you so much.  If anyone else is to use it just make sure you correct a little typo in it before you copy and paste it multiple times.  The second GetLayoutLbjectAttribute has an L where it should be an O - GetLayoutObjectAttribute