8 Replies Latest reply on Mar 6, 2014 9:42 PM by philmodjunk

    Change to Browse or Find Mode different tab controls.

    barriec7

      Title

      Change to Browse or Find Mode different tab controls.

      Post

           I have two tabs on a layout. I want to be able to automatically switch to Find mode when user hits Tab A (START) and Browse mode when user hits Tab B (RECEIVER SHIPPER). (These are navigation tabs, not tabbing between fields). I use onLayoutEnter in script triggers for layouts without tab controls.

           I have experimented with using script triggers with buttons overlaying each tab, but my solution as implemented forces the user to hit the tab twice, with my belief there that the button isn't useable until the tab is selected first.

           Thank you. Barrie.

      snapshot.gif

        • 1. Re: Change to Browse or Find Mode different tab controls.
          philmodjunk

               Your buttons are part of the tab panel. If you cut and paste to remove them from the tab panel, you can put them back so that one or more pixesl of the button are outside the boundaries of the tab and then it will not be "owned" by the tab control.

               But you can also use the OnTabSwitch script trigger if you are using FileMaker 12 or newer. There are get functions that can be used to identify the tab that your are "switching to" by clicking this tab.

               And in older versions, it's more complicated but OnObjectModify and GetLayoutObjectAttribute can be used to produce the same results.

          • 2. Re: Change to Browse or Find Mode different tab controls.
            barriec7

                 Thank you Phil. I am using FM 13 and will looking to the OnTabSwitch trigger...should do the trick. 

                 Yes...I tried the make the button larger than the tab method and in Filemaker 13 for me it wasn't successful. see the example below for what i experimented with (the buttons are dragged half off and grossly oversized for testing purposes).

                 when switching to other tabs those buttons disappeared.

                  

                  

            • 3. Re: Change to Browse or Find Mode different tab controls.
              barriec7

                   By way of follow-up...thank you so much for your help Phil, as you got me going in the right direction and thinking a little more smartly.  In Filemaker 13 for what I am trying to accomplish has been changed to OnPanelSwitch and allows a person to run a script whenever the tabs are changed...which means we don't need the buttons as a way of executing a script anymore I reckon.

              • 4. Re: Change to Browse or Find Mode different tab controls.
                philmodjunk

                     To answer why your test didn't work. The button shown is fully within the boundaries of the tab control and thus is "owned" by a specific tab panel. What I suggested was to place the button higher on the layout relative to the tab control so that at least one pixel of the button extends above the top border of the tab control.

                • 5. Re: Change to Browse or Find Mode different tab controls.
                  barriec7

                       Phil..thank you. we've come this far, so how about one more question. I have proceeded (correctly this time) as you originally directed and it solves the issue of the buttons being available across all tabs. (see pic below).  what i still have trouble with using this solution is that the buttons seem to be laying under the tab control. they still work, but only after a second push. (by the way, using the buttons i am directing to a script that says 'go to this tab' and then enter find or browse mode. the script works fine if i click on the area of the button above the tab.

                  • 6. Re: Change to Browse or Find Mode different tab controls.
                    philmodjunk

                         IN layout mode, select the button and choose Move to Front from the Arrange menu or click the control for that in the Inspector's position tab. Then try dragging the tab control a few pixels (use undo to put it back). Do the buttons move with the tab control? if they do, they are still "owned" by the tab control.

                         Here's a screen shot of where I tested this method in FileMaker 13, Windows 7:

                    • 7. Re: Change to Browse or Find Mode different tab controls.
                      barriec7

                           Phil...thank you for taking the time, as some of these issues are easy to solve and hard to diagnose for people of my experience.  I ended up solving this via scripting...I have attached an example that worked for me going the script route.

                      • 8. Re: Change to Browse or Find Mode different tab controls.
                        philmodjunk

                             Since you have FileMaker 13, you can script this much more simply using the Get ( TriggerTargetPanel ) to determine which tab was clicked.