glueing two shapes to each other - glue control handle

Started by miless2111s, August 31, 2016, 03:16:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wapperdude

Sorry, I must retract my assessment of adding the control point behavior.  It is not nearly so easy.  There is some built-in, underlying code that makes the PinX and PinY track with the control point once it is attached to another shape.  That code is inaccessible.

I considered the possibility of modifing an existing "Important" shape to retain all of the behavior, plus add the functionality of the "Callout" shape.  However, the Callout also utilizes built-in code it is no longer a trivial exercise to add its behavior to the modified Important shape.  The easiest work-around might be to group the two shapes, temporarily, move them, then ungroup.

Again, my apology.

Wapperdude.
Visio 2019 Pro

miless2111s

No worries, I'm glad I'm not alone in this and it wasn't something I was missing :)
Shame though - it would have been fantastically powerful to have the ability to hard link shapes for annotations etc.
Thanks for trying :)
Regards
Miles

wapperdude

I don't like disappointing.   >:(

Attached should work.  I did rework an "Important" shape.  Think I captured most of the desired behaviors.  Plus, added 1...the height of the vertical line will be the larger or the two cases:  text height or drawn height.  It will grow automatically, but, will not shrink unless manually resized.

To distinguish the new shape, I had to rename it from Important.  It still thinks it's master is Important, pun and no pun intended!   :o   That way it still gets the built-in effects.

Wapperdude
Visio 2019 Pro

Nikolay

#18
Brainstorm legend shapes appear to be managed by Visio "brainstorm" addin (solution), not by Visio core. That essentially means that all those user cells are created by background "brainstorm" addin which is obviously limited to brainstorm diagram type, so I would avoid messing with those :)

For a similar general-purpose solution, you could probably just use "callout" shapes (Insert => Callout). Read more about callouts here for example:
https://support.office.com/en-us/article/Annotate-a-diagram-by-using-callouts-2f3a8780-4bab-45a3-88dc-ad2ac0b79cb9
https://blogs.office.com/2012/11/05/containers-and-callouts-in-visio/

There are various stock callouts that may fit you needs. You can build you own custom callouts, if you want to. See here for example:
https://blogs.msdn.microsoft.com/visio/2010/01/12/custom-containers-lists-and-callouts-in-visio-2010/
https://blog.bvisual.net/2014/04/08/adding-configure-callout-functionality-to-visio-callouts/

wapperdude

Ah.  Yes.  I see where my "solution" might be misleading... wasn't really clear about the underlying code, nor the fact that the code is tied to the brainstorm addin, thus leaving open the possibility of "transporting" the solution to other Visio applications.

Guess it's one of those weekends.

Well, for a very limited scenario, the "solution" does work.

Thanks Nikolay.
Wapperdude
Visio 2019 Pro

miless2111s

Quote from: wapperdude on September 05, 2016, 06:45:02 PM
I don't like disappointing.   >:(

Attached should work.  I did rework an "Important" shape.  Think I captured most of the desired behaviors.  Plus, added 1...the height of the vertical line will be the larger or the two cases:  text height or drawn height.  It will grow automatically, but, will not shrink unless manually resized.

To distinguish the new shape, I had to rename it from Important.  It still thinks it's master is Important, pun and no pun intended!   :o   That way it still gets the built-in effects.

Wapperdude
It's interesting - the behaviours of these shapes are inconsistent; initially when opened moving the target shape around moves the linked items as required, however as soon as they are repositioned they start behaving like normal call outs - i.e. they're fixed in place and the line moves to maintain the link with Target. :(
Another interesting feature is that when you grab the horizontal arrow cursor that appears in the centre of the call out text line and drag it right over the text the line extends from top to bottom of 6 pages up and down!
Sorry that your work didn't manage to achieve what we wanted - I'll use your earlier suggestion of a rectangle hard glued to a brainstorm shape if I want to associate text with the "important" symbol.
Regards
Miles

wapperdude

Odd that it misbehaves.  The only significant change, I would think, was re-naming the shape, but keeping the master shape reference.  While I didn't try it in a busy environment, I did copy/paste, drag/move many more times  appears in the attached file.  Would have thought any fundamental issues would  surfaced.  All other changes were superficial. 

Oh well.

Wapperdude
Visio 2019 Pro

Yacine

Wouldn't Wapperdude's magic setatgetref things be a typical solution for this problem?
I recall him solving such a problem for me a while ago. http://visguy.com/vgforum/index.php?topic=5450.0;nowap
Yacine

wapperdude

Don't think so...at least, not in this case.  The problem is the limited functions avaliable in the shapesheet.  There's no way to test for gluing and there's no way to parse a formula.  Consequently, there's no way to determine if the control point is glued to something or not.  If there was, then, yes, I think the SetAtRef stuff ought to work.

Perhaps the newer versions of Visio have added shapesheet functions...but, that's for someone else to tackle.

Wapperdude
Visio 2019 Pro