Page 1 of 1
Tab Panel with visual effect - inconsistent?
Posted: Wed Jun 20, 2018 4:41 pm
by mluka
Hi all.
I created a Tab Panel with five tabs: "Tab 1", "Tab 2",..., "Tab 5".
I also created five fields, with the same names.
I added a script to the tab panel to show the field with the same name as the tab and to hide the other four fields.
Works fine.
Then, I wanted to "experiment" with visual effects.
In the part of the script that relates to "Tab 2", in the statement that shows "Field 2", I added "with visual effect checkerboard slow". Cute, eh?
Here's the problem (and my question): If I click on "Tab 1", which shows "Field 1", then on "Tab 2", "Field 2" is shown, with the visual effect. Spectacular!
HOWEVER, if before clicking on "Tab 2", I first click on "Tab 3" or "Tab 4" or "Tab 5", "Field 2" is shown, but WITHOUT the visual effect!!!
My question: How come???
(NOTE: I probably created the five fields in the sequence 1, 2, 3, 4, 5. So the fields are probably layered in that sequence. Could this have anything to do with this behaviour???)
Thanks.
Re: Tab Panel with visual effect - inconsistent?
Posted: Wed Jun 20, 2018 4:51 pm
by Klaus
Bonjour Michel,
please post the script of your TAB panel!
I created a Tab Panel with five tabs: "Tab 1", "Tab 2",..., "Tab 5".
I also created five fields, with the same names.
That's great, a clever naming convention is half the rent!
Best
Klaus
Re: Tab Panel with visual effect - inconsistent?
Posted: Wed Jun 20, 2018 4:55 pm
by dunbarx
Hi.
Anything to get out of doing my day job.
So I made a tab panel with five tabs as you said, and five fields with names as you said. I did this in the tab panel script:
Code: Select all
on menuPick tItemName
repeat with y = 1 to 5
hide fld ("tab" && y)
end repeat
show fld tItemName with visual effect checkerboard slow
end menuPick
Everything works fine, regardless of the tab I click on. LC 8.1.9.
By the way, "checkerboard" does not look good for the small fields I made. I tried "barn door" and it was much smoother.
Craig Newman
Re: Tab Panel with visual effect - inconsistent?
Posted: Wed Jun 20, 2018 5:05 pm
by Klaus
Hi all,
"menupick" comes with TWO parameters, see below how to use it!
Code: Select all
on menuPick tClickedTab, tPreviousTab
## Set speed of visual VERY SLOW effect!
## Yep, strange, but it only controls the VERY SLOW effect :-D
set the effectrate to 500
## (not so) new and HIGHLY recommended syntax!
lock screen for visual effect
## This IS cool!
hide fld tPreviousTab
show fld tClickedTab
unlock screen with visual effect dissolve very slow
end menuPick
Best
Klaus
Re: Tab Panel with visual effect - inconsistent?
Posted: Wed Jun 20, 2018 7:00 pm
by mluka
Hi Dunbarx and Klaus. Thanks for your replies. Like Klaus said, in another thread, there are many ways to skin a cat!
My script is much less elegant, but here it is: (BTW I had not really named the tabs and the fields as I stated in my original post, for clarity's sake

)
Code: Select all
on menuPick pItemName
switch pItemName
case "Technique"
show field "Technique"
hide field "Utiliser"
hide field "Historique"
hide field "Suggestions"
hide field "Glossaire"
break
case "Comment utiliser"
hide field "Technique"
show field "Utiliser" with visual effect checkerboard slow
hide field "Historique"
hide field "Suggestions"
hide field "Glossaire"
break
case "Historique"
hide field "Technique"
hide field "Utiliser"
show field "Historique"
hide field "Suggestions"
hide field "Glossaire"
break
case "Suggestions"
hide field "Technique"
hide field "Utiliser"
hide field "Historique"
show field "Suggestions"
hide field "Glossaire"
break
case "Glossaire"
hide field "Technique"
hide field "Utiliser"
hide field "Historique"
hide field "Suggestions"
show field "Glossaire"
end switch
end menuPick
Thanks for your comments.
Re: Tab Panel with visual effect - inconsistent?
Posted: Wed Jun 20, 2018 7:05 pm
by Klaus
Please get used to the VISUAL EFFECT syntax I wrote above!
The dictionary is out of date, using the old syntax can even crash an iOS app!
Re: Tab Panel with visual effect - inconsistent?
Posted: Wed Jun 20, 2018 9:14 pm
by mluka
Please get used to the VISUAL EFFECT syntax I wrote above!
Thank you Klaus. I will, I will.
The dictionary is out of date
This is distressing! If, as a newbie, I cannot rely on the Dictionary, what should I use as a reference?
Re: Tab Panel with visual effect - inconsistent?
Posted: Wed Jun 20, 2018 9:26 pm
by Klaus
Don't worry, the entry in teh dictionary for "visual effect" is the only one I know that is a bit out-of-date!
