Author Topic: Hide subshapes based on either of two flags  (Read 3367 times)

0 Members and 1 Guest are viewing this topic.

scott

  • Full Member
  • ***
  • Posts: 97
Hide subshapes based on either of two flags
« on: May 15, 2008, 01:49:27 AM »
Chris,
I recently reread your 2006 post about various ways to hide shapes. My question is a variation on that theme.

Basic situation: a group with several subshapes. Certain subshapes can be hidden in one of two ways: by setting a flag on the group or by setting a flag on the page.

Page flag: User.pgHideSub

Group flag: User.grHideSub

Subshape formula in Geometry1.NoShow: OR(<group>!User.grHideSub, ThePage!User.pgHideSub)

This setup works fine and hides the subshape if either flag is set to TRUE.

And now for the question: If the user sets the page flag to FALSE, I want to force User.grHideSub to FALSE as well. I can do this by creating another group cell called User.Watch_pgHideSub with a value of
     IF(ThePage!User.pgHideSub=FALSE,SETF(GetRef(User.shHideSub),FALSE),"")
While this works, is there a more elegant way that doesn't require the "watch" cell?

Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1716
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Hide subshapes based on either of two flags
« Reply #1 on: May 15, 2008, 02:29:48 AM »
Hi Scott,

Yeah, I know what you mean. Too many SETFs starts to feel weird.

One technique I used to use was to put a setting on the shape to "Use Page Setting", and had that as the default. So if you hide something via the shape, then it is an override of the page setting, and won't listen to the shape. But if you revert to "Use Page Setting", the shape is again a team player.

Not quite as flexible or powerful as yours, but slightly less 'icky'

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010