Dynamic connector, lock text, need to move text

S

sonzos

I have made my own dynamic connector, and have put 2 custom properties
on it

Id
Name

The text on the dynamic connector is linked to the Name, so what stands
in the name cell stands on the shape.
Now to prevent the users from double clicking the connector and change
the text, so this link is destroyed, i have protected the connector by
setting the cell LockTextEdit = 1.

The problem is, that the user should be able to move the text on the
connector, but he cant do that because of the LockTextEdit protection.

Is there a way to protect the Link between text on connector and custom
property, without setting the the LockTextEdit. So the user can move
the text, but not edit it?
 
J

John

Sonoz,

You could add a Control and then assign the TxtPinX and Y cells of the Text
Transform section to the respective cells in the control.

Also, you might want to consider tying the source text to a custom property
rather than the shape name as this would change if, for example, a user
tried to copy or duplicate the shape.

Anyway, hope that helps.

Best regards

John
 
S

sonzos

Thanks, works fine

only one thing i want to add
remember to guard() the textPin x and y, or else they will be
overwritten when you move the connector.
 
M

Mark Nelson [MS]

Visio 2003 offers a better solution than GUARD for preserving the link
between Text Pin and Control Handle. Try this:

TxtPinX = SETATREF(Controls.TextPosition)
TxtPinY = SETATREF(Controls.TextPosition.Y)

SETATREF means forward the value to the referenced cell when setting it.
This allows you to keep multiple cells in sync. If you change the control
handle position, the text pin cells are updated via formula as usual. If
the change the text pin position, the new value is not written directly in
the text pin cells; it is forwarded to the control handle cells and set
there.

BOUND, SETATREF, SETATREFEVAL and SETATREFEXPR are new functions in Visio
2003 that offer powerful control over shape behavior.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top