Control acts opposite of expected

Started by Michelle, August 05, 2010, 07:35:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Michelle

I have a shape that has text that I need an end user to be able to move.  The text is in a sub-shape of the main shape, so I added a controls section to the main sheet and tied the controls to the text.  All seems to work fine at first, the controls do move the text as desired.

BUT if the user rotates the shape *then* moves the text, the control diamond seems to work opposite of what is expected.  If the user pulls the control down, the shape goes off at an angle.  I assume the angle is a function of the angle the shape was rotated to, but I can't figure how to make the text move right along with the control.  I do have the text controlled from flipping upside down when the shape is rotated by putting "GUARD(-(Sheet.5!Angle))" in the Angle cell of the Shape transform section of the Text's shapesheet. 

How can I make the text move right along with the control diamond even when the main shape has been rotated to any random degree? 

TIA,
Michelle

Yacine

Hi Michelle,

It is apparent that the text takes the coordinates of the control point in the group, but expects them coming fom it's owner - the sub-shape.

One could recommend some loctoloc or loctopar, but I am one of the many who have not understood it. Plus I am  notoriously lazy.

So my advice would be to remove that extra level of coordinate transformation by separating the sub-shape from the displayed text. Insert in your group a simple text shape, glue it to the control point of the group and if necessary link it's content to the sub-shape.

HTH
Yacine
Yacine

wapperdude

Yacine was on the right track with the Loctoloc function idea.  Easier to do than to explain.  See attached.

There are 3 shapes, groupped, resulting group shape is #4.  Control pin added to this shape.  Shape1 has text that counter rotates to stay level reading, and is moveable with control point.

HTH
Wapperdude
Visio 2019 Pro

Yacine

OK, that's much easier and elegant.
Could someone point me to a good article about these functions?
Yacine

Jumpy

In my opinion that is complicated. I would not move the text of a subshape, because what is the reason for that?
I would add a text only shape to the group and move that complete subshape.
So you can tie its PinX/Y direct to the Control without complicatet coordinate-transfomrations.

Last but not least I would not stop the text from rotating with the shape with =-Sheet.!Angle because the formula does not work if the shape is flipped (in one direction (if in two it works again)).
I use a User cell in the group shape User.Angle =IF(FlipX+FlipY=1,Angle,-Angle) and in the angle cells of text shapes I would write =Sheet.4!User.Angle

There is another formula that does the same but uses a shapesheet function, I think BITEXOR or sth.

wapperdude

Regarding text behavior, here's a more complete treatment:  http://msdn.microsoft.com/en-us/library/aa200986(v=office.10).aspx, which includes a discussion on the flipping issue that Jumpy refers to.

Also, VisioGuy addresses that issue in a reply to this topic:  http://visguy.com/vgforum/index.php?topic=44.0

Hope these are interesting! 

The implementation of using loctoloc or loctopar goes beyond just moving text, and extends to shapes and parts of shapes.  Likewise, with the anti-rotation, which could also be used to control the rotation of shapes within a subgroup, or totally independent shape(s).

...toward a more complete answer.
Wapperdude
Visio 2019 Pro

Michelle

Wapperdude,
Thanks for the reply.  I think I have some slight understanding of the LOCTOLOC command.  I am trying it out, and it's working better than it did, but I am still haveing problems with my shape.  My shape in addition to needing to be able to move the text offers choices for size from a pull down menu.  The problem is, it seems like no matter what I do, the text location is in some way a function of the width.  (And I have been around and around with this shape!)

I have attached my shape, maybe someone can see what I am doing wrong.  I would like the text to stay where it is when different Classes (widths) are chosen from the pull down.  Of course, then I want the text to move when the user needs it to by using the control point.  Not asking too much right?  ;D

Thanks to all!

wapperdude

The problem is that the control is always tied to the width.  So, the text will move whenever the width changes. 

You will have modify how you change your thickness such that the group width doesn't change.  You might consider modifying the geometry section, such that the "x" points become variable multiples of the width based upon thickness choice, but the actual width doesnot change.  One consequence is the shape selection box will not always match the size of your shape.

Anyway, that's a quick thought.

Wapperdude.
Visio 2019 Pro

Jumpy

It may be worth to give the SETATREF-Function and family a try.
Have not used it with controls jet, but there should be a solution.

Yacine

It is so much easier to solve a problem when we get the actual shape uploaded.

Michelle, the xbehavior cell of your control point need just to be set to 2 = offset min, so there is a numerical value in the x coordinate instead of a function of the width. I'd say: problem solved.
Yacine

Michelle

Oh wow, Yacine... you are the Man! (Woman?)  I can't believe the solution was so simple!  Thanks for your help  ;D