Jump to content

Hiding control depending on the tab


avallejo
 Share

This topic is 2869 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hi all.

What I want is to hide some text I placed in the footer unless I'm in a certain tab. I see a "hide control" property , but I can't figure out how to construct the command or script to put into it...

Any hints?

best, Andre

Link to comment
Share on other sites

I see a "hide control" property , but I can't figure out how to construct the command or script to put into it.

 

Assuming that you mean the “Hide object when” setting in the Inspector, try this calculation:

not GetLayoutObjectAttribute ( "yourTabPanelObjectName" ; "isFrontPanel" )

Note that this function uses an object name (that you assign to the tab panel in the Position tab of the Inspector). Don't use the tab panel's title.

 

You'll also need a mechanism to refresh the display; you could write a single-step script with “Refresh Window” (leave the options at the bottom unchecked) and attach that script to the tab control with an OnObjectModify trigger.

 

Depending on your workflow, there may be a better solution for hiding (or placing) the object; hard to say.

  • Like 1
Link to comment
Share on other sites

  • Newbies

Hi eos.

Thanks for the answer.

I did try it, and indeed the text disapear, but then it won't apear when I enter the tab. I did attach the Refresh Window script to the tab control, but no success...

I'll keep trying...!

André

Link to comment
Share on other sites

Hi Andre,

 

It should work fine as eos describes.  Here is a sample file.

 

One thing ... as Charity suggests, you should use Refresh Object[] instead of Refresh Window[].  Both would work but now in 13, Refresh Window[] works REALLY well (as it should have worked for years but didn't) and it refreshes the entire window (all objects) which is a very heavy hit.  Use it only if *nothing else works.  

 

Refresh Object[] just refreshes the object you specify so it is very light-weight. :-)

 

Another option which is even more resource-efficient ... since it only applies if that tab is showing, it might be more user-intuitive if it appears on the tab itself.

 

* I would go further and say that, if the only way to get the necessary screen refresh is to use Refresh Window, it would be worth considering a different interface approach.  There are exceptions such as some portal refreshes but use it cautiously. 

HidingObjects.fmp12.zip

  • Like 1
Link to comment
Share on other sites

This topic is 2869 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.