Newbie to Shapesheet - Toggling foreground color for a shape upon right click

Started by vidu, June 22, 2011, 02:11:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vidu

Hello,

I have a rectangle. I want to allow right click on the shape and toggle the foreground color. I want to call the two options on right click "Selected" & "Unselected". Selected option will make the shapes foreground color to be lightgrey and Unselected color to be in black.

I want  the checkbox seen before each of these options. I know we need to add the actions in the actions section of shapesheet, but I dono how exactly to do it.

This is want i want to achieve. One more question can those associated arrows also be toggled based on the selection? If so how to do that.




Any help is highly appreciated.

cheers,
Vidu

vojo

Need to go into shapesheet and create some cells

Action.row 1 = setf(getref(action.row_1,checked), if (action.row_1.checked, 0, 1))    //update description to something like "checked"...next cell on that row
Action.row_2= setf(getref(action.row_2.checked), if (action.row_2 checked, 0, 1))    //update description to something like "unchecked"

Fillforegnd = if (action.row_1.checked, <color you want>,if(action.row_2.checked,<another color you want>, <some default color>))

exit out of shape sheet and right click the shape

vidu

I tired to apply this in the shapesheet,

On row one - setf(getref(action.row_1,checked), if (action.row_1.checked, 0, 1))
On row two - setf(getref(action.row_2.checked), if (action.row_2 checked, 0, 1))

but it is throwing the error "Error in Formula".

Jumpy

action.row_1.checked

In vojo's and your code is an "," instead of a "." that is just a typo on vojo's part I think.

wapperdude

You can do this in a single action row, if you don't allow any other color editting --

In the Action cell enter:  =IF(Actions.Row_1.Checked,SETF(GetRef(FillForegnd),"GUARD(0)"),SETF(GetRef(FillForegnd),"GUARD(3)"))    Make the values in parenthesis the number of the color you want, or you could even use RGB(x,y,z).

In the Menu cell enter:  =IF(FillForegnd=0,"_Unselected","_Selected")

In the Checked cell enter:  =IF(FillForegnd=0,0,1)

HTH
Wapperdude
Visio 2019 Pro