5 Replies Latest reply on Dec 15, 2013 7:58 AM by philmodjunk

    Couple Tab questions

    JimBessette

      Title

      Couple Tab questions

      Post

           FM13 Pro Advanced.

           Couple of things I can't seem to get hold of.  

           1. There must be a way to be able to "stay on a tab" in a layout when using the left and right arrows for "go to previous/next record".   On one of my layouts, if I choose the 2nd tab (not "main" tab) and then click the go to next record arrow, the next record shows, and it stays in that tab (the 2nd one).  On another layout, if I do a similar thing, if I'm on say tab 5 and click go to next record, I see the next record, but I'm now on the 1st ("Main") tab.  Is there a way to set that to do either behavior?

           2. Tab color in FM13 seems to be broken, or something is taking over my style/appearance.  I'm afraid it's the latter, but can't figure out what is doing it.   I create a new tab.  I click the tab and choose a color background for it.  All good.  I exit layout.  The color of the tab itself is now some other color (like grayish, as my previous tab), not green like the background color I chose.  If I click the new tab, my green color is shown, including the tab part.  Open same file in FM12 and do the same thing, and it works as it had before. 

           TIA, Jim

        • 1. Re: Couple Tab questions
          philmodjunk

               1) You can give each tab panel an object name using the name box on the inspector's position tab. The OnTabSwitch script trigger can perform a script that uses the get function for the target tab panel to set a global field or variable to this object name. Then the OnRecordLoad trigger you can set for the layout can perform a script that uses go to object to put the focus on the correct tab panel (bringing it to the front) when you change records.

               2) In the appearance tab, check and see what state was selected when you selected the fill color. You can select different fill colors for Hover, normal, pressed and in focus states. It sounds like you didn't select the color for the Normal state if you only see the color when you select the tab--which would be the in focus state. There's a drop down for specifying the state.

          • 2. Re: Couple Tab questions
            JimBessette

                 Odd, I don't see my post here.  So, followup.  Since my existing script OnRecordLoad was doing a Goto Object and setting something, every time I moved between records, even when on a different tab, I would end up on the Main tab.  What I did was 2 things.  I added an "On Object Modify" trigger to the tabs, after naming the tabs.  (Side note: I really would have thought it should be the On Object Enter, but that didn't work.  OOM actually triggers when switching tabs).   Then in my script, I added an If statement to check if I was on the main tab, and only then, perform the script as before.  I did have to add the OOM for the tab (uses same script), because the record only is "Loaded" once and if I move between records in a different tab, then move the main tab, it didn't perform the script from the ORLoad.  

                 It's working like a charm.

                 Thanks Again (why my last thanks didn't show up is odd).

                 Jim

            • 3. Re: Couple Tab questions
              philmodjunk

                   Please take a look at the trigger "OnTabSwitch". It's a new trigger added with the release of FileMaker 12 and the new get functions that can be used with this to identify the tab panel that is now the front tab panel.

                   This method results in a much simpler script.

                   With older versions, you have to use GetLayoutObjectAttribute to test each tab panel to detect which one is now in front, but with FileMaker 12 and newer, you can use a single get function call to get the object name of the front tab panel instead.

              • 4. Re: Couple Tab questions
                JimBessette

                     Thanks Phil.  I can't find an "On Tab Switch", but I see "On Panel Switch" which must be the same thing.  I'll give it a look and report back if it makes things cleaner.

                • 5. Re: Couple Tab questions
                  philmodjunk

                       Yes, that's the one. They renamed the trigger in FMP 13 on me.