Hot Topic (More than 10 Replies) Need invisible tabs (Read 1968 times)
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Need invisible tabs
Jun 23rd, 2006 at 1:04am
Print Post Print Post  
I have been trying to make some TABS invisible.  Here is the code but it is not working for me.  TabPages are always Visible. How can I make them invisible?


// Hide/Show Elements
IF Blue <> YES Then {VISIBILITY(TabPage0,0) }
IF Blue = YES Then {VISIBILITY(TabPage0,1)      }
IF Red <> YES Then
{VISIBILITY(TabPage1,0) ; VISIBILITY(TabPage2,0) }
IF Red = YES Then
{VISIBILITY(TabPage1,1); VISIBILITY(TabPage2,1)      }

Red and Blue are combo boxes..  When Blue is selected I want to show Tab0
When Red us selected U wabt ti show Tabs 1 and 2.  Sometimes Both Red and Blue can be selected, and sometimes none are selected.  Not show is Tabs 3 and 4 that are always visible.

Code is in On Form Entry section.  When programe code is good was going to make it run when the combo boxes changed also.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Need invisible tabs
Reply #1 - Jun 23rd, 2006 at 1:44am
Print Post Print Post  
You can't use Visibility with individual tab pages. You can hide and show entire tab groups with Visibility, but Tab Groups work by hiding and showing their Tab Pages, so they don't respond to SBasic Visibility calls.

Bob Hansen suggests another method in this thread:
http://www.lantica.com/Forum3/cgi-bin/yabb2/YaBB.pl?num=1108140242/1#1
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Re: Need invisible tabs
Reply #2 - Jun 23rd, 2006 at 2:40am
Print Post Print Post  
Thank youjfor the fast reply.  I went to that link and it sounds like Bob Hansen was asking someone else to try his solution.  I did not see another answer to him.  As I read all the postings there I did not see anyone who has done this.  Will this be in the next version?  Is there a simple way to make all fields invisible on the Tabs even if the Tab label shows on the bottom??
  
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Need invisible tabs
Reply #3 - Jun 23rd, 2006 at 4:10am
Print Post Print Post  
Hello obfusc88...

You are correct, that I had suggested someone else to try an idea that I had, but there was no reply.

But I subsequently did try it myself, and although the layouts worked, I actually had to move the elements I wanted into a different database, so my idea ultimately was no good.

But there may still be a solution !

Try this for your problem.  Split the Tab group into three groups, each one with the TabPages that you want to toggle visibility on.

Group1 TabPages 3,4 X=0, is always visible
Put Group2, TabPage 0, to the right of Group1
Put Group3, TabPages 1,2 to the right of Group2

Since the entire TabFroup can change visibility, then turn visibility of multiple TabGroups on/off
If visibility is on, then set positions of Group3 X dependant on whether group2 is visible

Example:
All Tab groups have same "Y" value and the same Height.
Groups 1 is 400 wide, X value = 10
Group 2 is 100 wide, X value = 410
Group3 is 250 wide, X value = 510

If Blue = True then Group2 is visible else it is invisible
If Red is True then Group3 is visible else it is invisible.
     If Group2 is visible then Xpos( Group3, @XPos(Group2) + @Width(Group2) )     // X = 510
     If Group2 is invisible then XPos( Group3, @XPos(Group1) - @Width(Group1) )   // X = 410
     
This will reposition the third group if the middle group is invisible.  Or the third group can be invisible.  Or both Groups 2 and 3 can be invisible and you will still have Group1 visible at all times.

And good suggestion to provide this function in Version 2.  I agree.

Good luck, hope this was useful.
     
« Last Edit: Jun 23rd, 2006 at 3:21pm by Bob_Hansen »  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Re: Need invisible tabs
Reply #4 - Jun 23rd, 2006 at 3:08pm
Print Post Print Post  
Thank you for solution but it does not work for me.  When I do that I end up with moving wider across the screen.   So  I tried to make the tab pages narrower so they could still be side by side but I have too many fields on some of the tabs so I can't do this.  I really wanted to see the pages on  top of each other.  So I guess there is no way to this.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Need invisible tabs
Reply #5 - Jun 23rd, 2006 at 3:29pm
Print Post Print Post  
obfusc88 wrote on Jun 23rd, 2006 at 3:08pm:
Thank you for solution but it does not work for me.  When I do that I end up with moving wider across the screen.   So  I tried to make the tab pages narrower so they could still be side by side but I have too many fields on some of the tabs so I can't do this.  I really wanted to see the pages on  top of each other.  So I guess there is no way to this.


I think there is, but it is quite a bit of work. You can create a tab group with the tab pages and elements you want for each possible combination of choices. The elements on each set of tab pages should be bound to the same underlying fields so they stay in synch. Then you can make whichever tab group you want at the moment appear.  I'm not sure if having the elements appear in a particular position is important enough to warrant the amount work this would entail, but it would likely get you what you want.

You can also use Visibility to hide all the elements on a Tab Page, you just can't hide the Tab Page itself.

For what it's worth, Sesame 2.0 has SBasic calls to hide individual tab pages in a Tab Group.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Need invisible tabs
Reply #6 - Jun 23rd, 2006 at 3:43pm
Print Post Print Post  
Hello,

You could also do this without using a regular tab group at all. You would add a command button for each "Tab Page" you want to have. When a button is clicked on it will show only the elements that are on that "Tab" and hide all the elements on all the other "Tabs". So you create your own tab group by using programming. If you do not want a "Tab Page" to be visible you hide the command button and move the other command buttons to compensate for the one that is invisible. Depending on the size of your tabs it would take some programming but you could do it. And if you do, you would also be able to have On Tab Page Show and On Tab Page Hide events, since you control the hiding and showing of "Tab Pages".

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Need invisible tabs
Reply #7 - Jun 23rd, 2006 at 8:00pm
Print Post Print Post  
Good to hear this will be in Version 2! 

I was also going to suggest the same as Ray.
Since the narrow pages won't work, make them all the same size, all at the same X,Y position, and add one or more buttons to the form below the TabGroup (Above the canvas, per Ray's note).  A string of them across would be just like Tabs Indexes.  And have those buttons change the visibility of the TabGroups as you need them. 

So for the application you were describing, you would have three buttons, one for each of the TabGroups, that turns that TabGroup Visibility ON, and turns the other two OFF.  You could stretch the width of the 3 buttons to be as wide as the whole TabGroup.




« Last Edit: Jun 24th, 2006 at 8:14am by Bob_Hansen »  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Need invisible tabs
Reply #8 - Jun 23rd, 2006 at 8:45pm
Print Post Print Post  
Hello Bob,

Quote:
add one or more buttons to the canvas below the TabGroup


I think you meant Form and not Canvas. The Canvas is where you put elements if you do not want them to show up in runtime, Ghosted elements are on the canvas.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Need invisible tabs
Reply #9 - Jun 24th, 2006 at 8:13am
Print Post Print Post  
Thanks Ray   ...  I have changed it in the original ..... gotta stop these long hours,,,,
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Need invisible tabs
Reply #10 - Jun 25th, 2006 at 5:19am
Print Post Print Post  
Hello obfusc88
I just had a few more thoughts of help for you if you try to make all elements invisible on a TabPage.

1.  Remember to also make static text, boxes, and lines Invisible, not necessary, but makes a much cleaner picture, especially when combined with my next thought.

2.  Change the label on the TabPage to make it empty.  This will shrink the width of the Tab on the bottom to a very small area, (almost invisible).  Now if someone clicks on that Tab by mistake, they will see a totally blank page because you did step 1, removed ALL elements, not just data elements.

Here is the code to change the label:
Code
Select All
IF TurnOffTabPage = TRUE Then {
     LABEL(tabPage0,"")
     VISIBILITY(Element1,0)
     VISIBILITY(Element2,0)
     VISIBILITY(Element3,0)
     >
     >
     >
     VISIBILITY(Element99,0)
     }

IF TurnOffTabPage = FALSE Then {
     LABEL(tabPage0," Original Tab Label ")
     VISIBILITY(Element1,1)
     VISIBILITY(Element2,1)
     VISIBILITY(Element3,1)
     >
     >
     >
     VISIBILITY(Element99,1)
     } 


IF you don't think there would be a confilct with various labels on the Tabs, you could capture the current Label value and save it as a global variable, then use that global variable later when you need to restore the name of the label.  That wpuld make this more generic, and the value of the label would not be hardcoded.  But that is probably not useful if you are manually entering the element names to be toggled anyway.

Shocked
Hmm, that raises a new question....It should be possible to use a loop to make many elements VISIBLE, or READONLY, etc. but how can we identify the parent element of the data elements?  For instance, I don't think we can know that a particular element is on a TabGroup on ANY TabPage, nevermind knowing which specific TabPage it might be on.  Any chance that the magical Version 2 will provide this capability  ..the ability to ID the parent that all elements are attached to?  We now can see parenting when we move elements, so the logic is there under the covers somewhere.  This is the type of thing that Mark usually whips out right away.  Go for it Mark
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Re: Need invisible tabs
Reply #11 - Jun 26th, 2006 at 4:42pm
Print Post Print Post  
Now I have something that is working. I used the next two ideas

From Hammer:
You can also use Visibility to hide all the elements on a Tab Page, you just can't hide the Tab Page itself.

From Bob Hansen:
1. Remember to also make static text, boxes, and lines Invisible
2. Change the label on the TabPage to make it empty.

Thank you to Hammer and Bob Hansen.  This nis now works like invisible is on and off.  Even the tabs is not really invisible the tabs are so small that th tabs do not show up.   Only problem was making long list of over 30 fields on each tab but once I am over with that it was only one time to do that.  So this will work and thank you again for help.
  
Back to top
 
IP Logged
 
Alec
Lanticans
*****
Offline



Posts: 200
Location: Ascot, England, UK
Joined: Nov 22nd, 2002
Re: Need invisible tabs
Reply #12 - Jul 2nd, 2006 at 11:28am
Print Post Print Post  
When I've done this I've put a static text element on the middle of the form, saying "This tab page is intentionally blank". I've formatted it nicely, with a coloured border. When you make the other elements invisible make this message visible, and vice versa.
  

Alec
Back to top
IP Logged