philfeldman Posted November 11, 2006 Posted November 11, 2006 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
Matt Klein Posted November 11, 2006 Posted November 11, 2006 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.
Raybaudi Posted November 12, 2006 Posted November 12, 2006 Hi if nobody gives you a better solution, you can try this one... ( but you'll need EventScript plugin ) ActiveTab.zip
philfeldman Posted November 15, 2006 Author Posted November 15, 2006 Thanks so much. I tried this function, but I'll try again. Nice to know I am on the right track. Thank you.
fyanesv Posted June 7, 2015 Posted June 7, 2015 (edited) 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, 2015 by fyanesv
eos Posted June 7, 2015 Posted June 7, 2015 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).
fyanesv Posted June 7, 2015 Posted June 7, 2015 Wow!, Thanks eos, missed those two functions, never mind my script.
Recommended Posts
This topic is 3513 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now