2 Replies Latest reply on Aug 22, 2014 8:33 PM by symbister

    "Invisible" buttons overlaying tab controls



      "Invisible" buttons overlaying tab controls



           I'm setting up a tab control on a layout, but with overlaid 'invisible' buttons to run a script when a tab is selected, however I'm having to double click the tab, once to activate the tab, then to trigger the script. I'm sure I've seen a solution somewhere where this is achieved with a single click - any clever suggestions? Each tab control will have a portal, filtered to match the tab control label.

           I realise that I could achieve this with a 'fake' tab control, triggering a layout change, but would like to stay on same layout

        • 1. Re: "Invisible" buttons overlaying tab controls

               Well you don't really need the buttons at all with current versions. In FileMaker 11, you can use the OnObjectModify trigger to perform a script and the script can use getLayoutObjectAttribute to detect which panel is the "front panel"--the panel that you clicked. In FileMaker 12 and 13, it's easier as you have a new script trigger OnPanelSwitch (name is different in v12) and get functions--one that returns the name of the panel that was in front and one that returns the name of the new panel that is about to be the front panel.

               But if you want your buttons to work you have to set them up so that they are not "owned" by an individual tab panel. If you were to temporarily assign a fill color to your buttons so that you could see them, you'd see that they appear and disappear along with the tab panels that you are clicking. Drag them off of the tab control, then drag them back and position them so that at least on pixel of the invisible button extends above the border of the tab panel. This is how we did it before we used script triggers.

          • 2. Re: "Invisible" buttons overlaying tab controls

                 thanks Phil...once again a fount of wisdom...