Using EventDblClick to Change Shape's NoFill Cell

Started by red, October 22, 2008, 08:50:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

red

I'm trying to do what I think should be simple, but I'm having problems. I want to toggle the GeometryNoFill statusĀ  on a shape between TRUE and FALSE based on a Double Click on the shape. I'm really new to this, so I hope this isn't a poor question.

What I tried is

GeometryNoFill=EventDblClick in the geometry section

and then in the events section

EventDblClick=IF(GeometryNoFill=0,1,0)

My logic was that the DblClick would only execute when clicked so it would read the current valve (0 or 1) of GeometryNoFill and then toggle GeometryNoFill to the new value

Any suggestions on what I'm doing wrong?

Visio Guy

Hi red,

EventDblClick is an "event cell", and events in the ShapeSheet go hand in hand with pushing formulas into other cells.

Try this:

EventDblClick = SETF( GETREF(Geometry1.NoFill), NOT(Geometry1.NoFill) )

That will toggle your cell's value. The SETF function actually writes information into the target cell. I like to use it as sparingly as possible, because a spreadsheet is supposed to be a collection of dependencies. But in event cells like EventDblClick or Action cells, where the user explicitly wants to change the shape, SETF makes sense.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

red


vojo

BTW...you can extend this for richer function

user.mode_index=1

Eventdblclick = setf(getref(user.mode_index), if(user.mode_index < 10, user.mode_index=user.mode_index+1, 1)

some geometry cell = if(user.mode_index = 1, <do this>, if(user.mode_index = 2, <do that>, <do something other>))

etc etc....