Tab panel with different content

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
SEAL29
Posts: 63
Joined: Fri Oct 02, 2020 3:32 pm

Tab panel with different content

Post by SEAL29 » Wed Oct 14, 2020 6:11 pm

I can't resolve to have the tab panel on one card and different content under each tab.
I follow this lesson http://lessons.livecode.com/m/4071/l/75 ... ab-buttons Using Tabs on a Single Card to Hide/Show Content
But i can't create different content within tab panel.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Tab panel with different content

Post by Klaus » Wed Oct 14, 2020 6:35 pm

The example stack works fine!
Click on -> Spells
and then click the button at the bottom of the card: Tabs on a single card
That will open another stack whcih shows what you are looking for!

The trick is to GROUP all the "different contents" and give these groups the same name as the TABs in your tabbed button.
TABBED Buttons receive 2 parameters with the "menupick" message -> menupick NewClickedTab,PreviousTab
Then you just "show grp NewClickedTab" and "hide grp PreviousTab", see the substack "Tab_on_signle_card"!

SEAL29
Posts: 63
Joined: Fri Oct 02, 2020 3:32 pm

Re: Tab panel with different content

Post by SEAL29 » Wed Oct 14, 2020 7:09 pm

If I want the same fields on each tab with only different content like a template? Then everything has to be put on a separate card?

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Tab panel with different content

Post by Klaus » Wed Oct 14, 2020 7:14 pm

SEAL29 wrote:
Wed Oct 14, 2020 7:09 pm
If I want the same fields on each tab with only different content like a template? Then everything has to be put on a separate card?
Yes, that requires to have your controls on different cards!
Because fields can only use their "sharedtext" property on different cards, not on the same card!
That is why we need to specify the card, too:

Code: Select all

put the text of fld "the one with sharedtext" OF CD 1 into tText

SEAL29
Posts: 63
Joined: Fri Oct 02, 2020 3:32 pm

Re: Tab panel with different content

Post by SEAL29 » Wed Oct 14, 2020 7:20 pm

Thank you, i understand. One more question, the cards can be made scrollable with script or settings?

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Tab panel with different content

Post by Klaus » Wed Oct 14, 2020 7:34 pm

Stacks and card cannot be scrollable!
You could group all objects on your card(s) and show the group's scrollbars.

Post Reply