Author Topic: Using EventDblClick to Change Shape's NoFill Cell  (Read 5390 times)

0 Members and 1 Guest are viewing this topic.

red

  • Newbie
  • *
  • Posts: 5
Using EventDblClick to Change Shape's NoFill Cell
« on: October 22, 2008, 03:50:42 PM »
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?
« Last Edit: October 23, 2008, 06:02:51 AM by Visio Guy »

Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1718
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Using EventDblClick to Change Shape's NoFill Cell
« Reply #1 on: October 23, 2008, 06:02:04 AM »
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

  • Newbie
  • *
  • Posts: 5
Re: Using EventDblClick to Change Shape's NoFill Cell
« Reply #2 on: October 23, 2008, 08:17:53 AM »
Thanks. That did the trick.

vojo

  • Hero Member
  • *****
  • Posts: 1528
Re: Using EventDblClick to Change Shape's NoFill Cell
« Reply #3 on: October 23, 2008, 09:51:32 AM »
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....