David Nelson Posted November 18, 2011 Posted November 18, 2011 Alright, I need some help. I read up on it and searched and I am still stuck. I have three tabs. Layout opens on default tab 1. If I select 2 or 3 I want script to run and script to run if returning to tab 1 but not if clicking tab 1 if they have never gone to 2 or 3. So I named them 1, 2 and 3 using the object name and I was thinking of something like this... If[ GetLayoutObjectAttribute( "2" ; "hasFocus" ) set variable $$left1 to "2" perform sub script [script #2] Else if GetLayoutObjectAttribute( "3" ; "hasFocus" ) set variable $$left1 to "3" perform sub-script[script #3] else If[ $$left1 > 1 set Variable[ $$left1 to "" ] perform sub script[script Verify] In testing, script has only Show Custom dialog[ GetLayoutObjectAttribute( "2" ; "hasFocus" ) and it should give me a 1 if I go to tab 2 but all I get is 0 no matter what I try. None of them work. In reading, it seems it should work. Please advise if I posted in wrong section and I will try to move it but it seemed most appropriate. And if you need more information I can provide.
comment Posted November 18, 2011 Posted November 18, 2011 I think you want to use "isFrontTabPanel" instead of "hasFocus".
David Nelson Posted November 18, 2011 Author Posted November 18, 2011 (edited) Oh. I see. hasFocus seemed to fit. I thought isFront would say which was default tab. It says, "isFrontTabPanel - returns 1 (True) if the target object is the tab panel that is in front." I did not test it but I see now that it works like I want and it isn't just telling me which is the front default tab. Thank you. Just for my understanding can you explain how hasFocus might be used? It says it can be used with tab panels but if it isn't saying the tab is selected then what might it mean? I thought 'focus' meant selected, like in windows. Edited November 18, 2011 by David Nelson
David Nelson Posted November 18, 2011 Author Posted November 18, 2011 And while here, may I ask another question? At the bottom of the layout when I am working, each part is named, heading, body. But those names make it impossible to put fields there because I can not see labels to move them nor can I see fields if small. I am beyond frustration with the body tab and I want to make it disappear or move it to the other side so I can see when placing things in that left area. Possible? This forum is sure nice improvement from the one on filemaker website.
comment Posted November 18, 2011 Posted November 18, 2011 "hasFocus" does mean "selected" or "active" - i.e. contains the cursor. AFAIK, the only way to make a tab panel active (in Browse mode) is to include it in the layout's tab order, then tab into it. To toggle part labels between horizontal and vertical, use the button at the bottom of the window (next to the mode selector). 1
David Nelson Posted November 26, 2011 Author Posted November 26, 2011 It has taken me a while to study all of these pieces. Thank you for explaining, it is good to know the difference. And my tabs are all working great but I realize I have wrong structure and need to remove all 128 tabs (10 tabs with 28 tab panels within each) I just built. Funny. I keep reading things from which I learn that I would have done it wrong if I had gone ahead before learning it. I am inclined to tie my hands so I do not work on it and only focus on test files for at least six months more. About the layout labels - I swear I have clicked that icon many times and could never figure out what it did. This is perfect example where a designer (FM) has put an icon on a layout and the person does not know what it means. Maybe FM should be reminded to use tooltips. What would you call this thing (layout tab?) so I can look it up or make suggestion to FM? Thank you again for your assistance.
Recommended Posts
This topic is 4746 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