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?
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.
Thanks. That did the trick.
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....