News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

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....


Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 208 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1059KB.
Tokens: post-login.
Cache hits: 13: 0.00187s for 26,729 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]