November 11, 200619 yr I have a tab control layout object with several tabs. I have a global field entitled "g.active tab". I want to set g.active tab to the name of the active tab of the tab control object. I hope this is clear. For example, my tab control object has Student Teachers as tab 1 and Methods Courses as tab 2. When the Student Teachers tab is active, I want to g.active tab to hold the value "Student Teachers" (the name of the tab). Thanks in advance... I hope this can be done!! Phil Feldman
November 11, 200619 yr FileMaker Pro 8.5 introduced a function for returning all kinds of information about layout objects. The function is called GetLayoutObjectAttribute. Assuming you have given each tab panel an object name , you can use the "isFrontTabPanel" property with this function to determine if a certain tab panelis the front panel. Maybe you could the GetLayoutObjectAttribute function to accomplish what you are looking at.
November 12, 200619 yr Hi if nobody gives you a better solution, you can try this one... ( but you'll need EventScript plugin ) ActiveTab.zip
November 15, 200619 yr Author Thanks so much. I tried this function, but I'll try again. Nice to know I am on the right track. Thank you.
June 7, 201510 yr Hi, For any one looking for a different solution I wrote this simple script called "Get Front Tab Panel Value", no plugins, use as standard for any number of tabs, just use Script Trigger with the help of Optional Script Parameter. The Global Variable "$$Front_TabPanel" holds the Active Tab. One time Script: Set Variable [ $Loop_Count; Value:2 ]Set Variable [ $N_Parameters; Value:GetValue(Get ( ScriptParameter );1) ] Loop If [ GetLayoutObjectAttribute ( GetValue( Get( ScriptParameter );$Loop_Count) ; "isFrontTabPanel" ) ] Set Variable [ $$Front_TabPanel; Value: GetValue( Get( ScriptParameter );$Loop_Count) ]Exit Script [ ] End IfExit Loop If [ $Loop_Count ≥ $N_Parameters + 1 ] Set Variable [ $Loop_Count; Value:$Loop_Count + 1 ] End Loop Two Additional Steps: 1.- On Layout Mode Name each Object Tab using the inspector, (I use the same name on my Tabs). 2.- Set a Script Trigger "OnObjectModify" to call the above script, Its very important to use the "Optional Script Parameter" like the following Example tabs: Tab1 Tab2 Tab3 Tab4 Optional Script Parameter loks like this: List(4;"Tab1";"Tab2";"Tab3";"Tab4") (First Parameter will tell Script how many tabs you have) This way you can use the same Script for all your Tab Control Panels, just set the first "Optional Script Parameter" to the corresponding count of Tabs followed by the corresponding Tab's Names. Hope this helps anyone; FY Edited June 7, 201510 yr by fyanesv
June 7, 201510 yr Since now it is 2015, I think you may want to look at the trigger OnPanelSwitch and its accompanying functions Get(TriggerCurrentPanel)Get(TriggerTargetPanel) available as of FM12 (though with slightly different names).
Create an account or sign in to comment