shape sheet "edit"option to a shape

Started by kiler40, September 23, 2013, 10:36:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kiler40

hello All :)
Sorrry for flooding this forum :) But the ideas and issues comes constantly in my head...

i`ve done a smart shape with several options, but when i introduced it to my colegues, one of the first things that i was asked was "chan we change the way it looks". Of course i answered "no" (because my colegues don`t unedrstaind so much visio, and if they ungroup the object for any reaso... the functionality is gone :)
But then i`ve started to think in this way... why not to do it. create control points that can change different parts of the shape if wanted.
So far, So good.
But here are the questions. (question 1) I still cant understand how to make limits of a control point movement.
And the Biggest question - i want to add edin menue/option to my shape.

I don`t want this in the shape sheet window. And if it is possible to have check box for chainging. Like if i have 3 shapes in the master shape, when i want to edit to open a dialog box that have three check boxes:
"edit shape 1-2-3" and when selected the control points of shpe one becomes available...
or if it is not control point but color, to choose from color list... hope you get my point... :)
i know how to do all of this as a function that is shown in the shape sheet window (exept my question 1 from the top of the post) but how not to fill screen with this information if you don`t want to change the shape.
I can also add it to the right click menue and
If edit=true
to make edit options visible. but i also don`t know how to make a right click menue act as "true" or "false" (still prefer a popup window :) )
i understaind, this is something hudge (at least for me) but so far all of you fave been so helpful to me... so need to ask :)

One more thing. I have a previous post that asks about shape that is making my file to slow, and the explanation was about all the calculations visio needs to make for a "simple" resize. Will this edit option (if possible to make) will slower down even more the file ?

Thanks in advance :)
Andrei!

Jumpy

To limit movement of a control point there are 2 concepts. First you can restrict it's movement along one axis using the X/Y Dynamics cells in the ShapeSheet.

http://msdn.microsoft.com/en-us/library/office/aa200978%28v=office.10%29.aspx

The other way is using one or more user defiend cells, that set back the control point, if it's out of bounds:

User.CP1  = If(Controls.CP1.X>30mm,SETF(GETREF(Controls.CP1.X),30mm),"")

That formula sets the X-Position back to 30mm if x is bigger than 30mm.

-------------------

Say you want to control the visibility ot the control point (the "editability" of the shape) with an action (right click menu). You could give it a Text like "Enabled" an in the action you only trigger if taht action checked or not.
=SETF(GETREF(Action.MyAction!Checked),Not(Action.MyAction!Checked)).

In a control point in the visible cell you write sth. like =Action.MyAction!Checked   or =Not(Action.MyAction!Checked)

------------------------

An technic I often use is using shape data to alter a shape. For example in my pipes you can pick a temperature of the fluid running through the pipe (in the shape data window) and the pipe alters it's color from blue=cool to red=hot. So I control the visible features of my shape from the shape data window that my user's have always open.

JohnGoldsmith

#2
Hello Andrei,

Adding to Jumpy's points, here some more answers to your questions (hope I've understood correctly):

Limiting control points – Have a look at the BOUND function, which is designed specifically for this purpose (at least constraints anyway).  Here a couple of links where I've used it in the past:
http://visualsignals.typepad.co.uk/vislog/2011/02/dot-grid-backgrounds.html
http://visualsignals.typepad.co.uk/vislog/2012/01/creating-a-color-picker-in-visio.html (see the horizontal and vertical control handle cells in the group shape)
and a great overview of BOUND from the Visio team: http://blogs.msdn.com/b/visio/archive/2006/10/03/staying-in-bounds.aspx


Set shape type from context menu – My approach would be roughly as follows:

       
  • Add a Shape Data row to hold your options
  • Use a lookup in a user cell to hold the index of the shape type
  • Add other user cell variable to hold shape visibility and other functionality as required
You can see an example of this in my Bitwise post:
http://visualsignals.typepad.co.uk/vislog/2013/03/using-bitwise-functions-in-visio-part-2.html
Although it mainly deals with bitwise functions the early part describes possible approaches to creating a shape with varying options.


Edit menu option – Try this:

       
  • Add a Shape Data row Prop.EditMode and set its Type cell to 3 (Boolean)
  • Add an Actions row (Actions.EditMode)
  • Set Actions.EditMode.Menu to "Edit mode"
  • Set Actions.EditMode.Action to =SETF(GETREF(Prop.EditMode),NOT(Prop.EditMode))
  • Set Actions.EditMode.Checked to =Prop.EditMode
You can then reference Prop.EditMode from other cells/shapes and use it accordingly.  For example: Geometry1.NoShow = NOT(Prop.EditMode), which will hide the respective geometry if EditMode is not true.

Will this hit performance – No, it shouldn't do as the dependent cells should only be recalculated as the Shape Data / Action row value change, although I guess it depends a little on how much functionality you decide to hang off those variable cells.


Anyway, hope that helps.
Best regards
John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

kiler40

Thank you both about your replays. I`ll try all, and if something comesout, i`ll ask.

Thank you Again :)

Andrei