How do populate object into Tab Panel
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
How do populate object into Tab Panel
Hi all,
I have to create a tab panel with 3 tab (Tab1, Tab2, Tab3.) and each table must have fields buttons etc.
I have tried to add the objects but do not remain in the individual tables
how Do add a object into single tab panel?
Thanks in advance
I have to create a tab panel with 3 tab (Tab1, Tab2, Tab3.) and each table must have fields buttons etc.
I have tried to add the objects but do not remain in the individual tables
how Do add a object into single tab panel?
Thanks in advance
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
A tab control in Rev is a single object, and is not a container of other objects.
But cards and groups are containers, so you can either put the controls for each tab on separate cards after placing the tab into a group that's shared across all the cards, or put the controls into group and just swap the visibility of groups from the tab.
I tend to go the group route myself, in which I make a group for each tab using the name of that tab, and a script in the tab control something like this:
But cards and groups are containers, so you can either put the controls for each tab on separate cards after placing the tab into a group that's shared across all the cards, or put the controls into group and just swap the visibility of groups from the tab.
I tend to go the group route myself, in which I make a group for each tab using the name of that tab, and a script in the tab control something like this:
Code: Select all
on menuPick pItem
repeat for each item tTab in "Tab 1,Tab 2,Tab 3" -- tab names
set the vis of grp tTab to (tTab = pItem)
end repeat
end menuPick
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
HI Daross,
TABBED buttons receive 2 (two) parameters with the "menupick" message:
1. the item chosen
2. the item that has been previously chosen!
So you could also script:
Best
Klaus
TABBED buttons receive 2 (two) parameters with the "menupick" message:
1. the item chosen
2. the item that has been previously chosen!
So you could also script:
Code: Select all
on menuPick tNew,tOld
show grp tNew
hide grp tOld
end menuPick
Klaus
Hi Klaus,
I have seen and tried your script on the topic "Controls" to link:
http://support.runrev.com/scriptingconferences/
The link scripting conferences are a gold mine for us beginners and the 'learning is faster.
I have seen and tried your script on the topic "Controls" to link:
http://support.runrev.com/scriptingconferences/
The link scripting conferences are a gold mine for us beginners and the 'learning is faster.
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Klaus, there is an attractive simplicity to your method, and if one has a very large number of tabs might even yield a performance benefit.
But the reason I settled on my more "brute force" method is with the aim of defensive programming: groups' visibility may be affected by many things, whether other scripts in my app or other tools in the IDE, and walking through each group related to the tabs ensures that all groups are in their expected state.
In this case the stylistic difference is minimal, and I see no harm in doing it either way. But as a general rule, in recent years I find myself adopting ever more defensive programming practices, even at the cost of a few clock cycles per click, to help reduce the range of things that can go wrong somewhere else down the road.
But the reason I settled on my more "brute force" method is with the aim of defensive programming: groups' visibility may be affected by many things, whether other scripts in my app or other tools in the IDE, and walking through each group related to the tabs ensures that all groups are in their expected state.
In this case the stylistic difference is minimal, and I see no harm in doing it either way. But as a general rule, in recent years I find myself adopting ever more defensive programming practices, even at the cost of a few clock cycles per click, to help reduce the range of things that can go wrong somewhere else down the road.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: How do populate object into Tab Panel
Just sharing ....
More tabs than grouped controls.
More tabs than grouped controls.
Code: Select all
on menupick new, old
## new = Name of the chosen menu/tab
## old = name of the previously chosen menu/tab
Try
hide grp old
Catch lErr
end try
Try
show grp new
Catch lErr
end try
## That's all we have to script :-)
## Remember that the message will look like:
## menupick "One","Two"
## So this script is quite comprehensible...
end menu pick
Thanks to RunRev.
Thanks to LiveCode forum members.
LiveCode v5.5.5 - iOS Android Mac Windows - 6.5 Community
27" 2012 iMac i5, MacBook Pro, MacBook Air, iPhone 5, iPhone 4
xCode 5.0.2 - iOS7 - OS X Mavericks
Paid Apple iOS Developer Program Member
Thanks to LiveCode forum members.
LiveCode v5.5.5 - iOS Android Mac Windows - 6.5 Community
27" 2012 iMac i5, MacBook Pro, MacBook Air, iPhone 5, iPhone 4
xCode 5.0.2 - iOS7 - OS X Mavericks
Paid Apple iOS Developer Program Member