Line Connector Horizontal or Vertical Only Not Diagonal or Curved [Solved]

Started by jmw_visio, February 06, 2016, 11:54:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yacine

Hi jmw,
just to give you some feedback - which you deserve for posting so much. ;)
It is not obvious to the user what the primary shape is, so you need to explore the drawing and need to remember the chain sorting.
Synchronisation did not work for me.
Otherwise, GREAT JOB. Please continue working on this.
Cheers,
Y.
Yacine

jmw_visio

Thanks for the review!
Yes, the synchronization stuff is still John Goldsmith settings, I removed the two lablels that used it, so its broken right now, I left the prop in because he had a lot of nice user interface stuff setup. Since his is just one master its easy to reference the other Shapes Label Info thru Sheet References to transfer.
I plan on using the setting to transfer down from the Connected Shape and To Master across to all the From Masters connected. So if you set the To ID to 5 it will then make all the Froms connected 5 also.

I dug up some code a week ago that showed how to transfer the info along the glued connectors Shapes on each end. I now just have to go dig that back out and see if I can get that working. The idea is the shape at the beginning to have a couple data fields and when connected they are passed down to the From Connector.

I also have a dialog on drop that has options for numbering. Basically incrementing to the next number from the highest on the page, using an available gap say the current numbers are 1,2,5,6  it would use 3, and also the ability to reset all numbers to clear out any gaps.

I am also going to add some more generic text fields. I know the network guys love to include multiple address's, ports, etc.

Then I will also try and polish the interface more like Johns nice right click menus, etc.


Then my next big attack is Off Sheet Connectors. I played around some with the included one but since it uses canned code I cant get to, I figured rolling my own will allow more data transfer also.

Thanks for the time to review


jmw_visio

Ok Yacine,
Here is my first pass at synching the IDs.

Basically created a sub that runs off of the Glue BegTrigger.

It fires a lot!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! So I put some code to limit the amount of activity.

First I verify the shape is the currently selected one. I don't know why it fires for all the shapes instead of just the one I am gluing?!?!?!?
Second I use/store a copy of the BegTrigger field so I can see if there has been a change to what was glued. Works great for comparing when I change from one object glue to another. But if I disconnect the glue, the 2 never match to knock me out of the loop. Basically the BegTrigger has a reference to itself and the BegTrigger shows the _XFTrigger(MasterShapeName!EventXFMod) while when I store this to the User.BegGlue I get just _XFTrigger(EventXFMod) so that comparison is always false.

I got around this by just checking if the User.BegTrigger Value is a 2. If so I reset if its  then a 1 then I don't need to

When I do detect a new glue or unglue I set the User.ToID to be linked to the To Shape from the Connection. I then create a User.SetID which monitors and sets the Froms ID to the User.ToID if it changes.
On unglue I try and clear them.

On Page 2 I have set up a shape that has two 'To' connectors with diff IDs (1,2). I then have a shape with a 'From' connector ID of (0). If you select the 'From' connector you can move the Beg Point to the two connectors or unglue. The IDs should follow.

Would love for you to review.

Thanks

jmw_visio

Yacine
On this version I tried to address your comment "It is not obvious to the user what the primary shape is, so you need to explore the drawing and need to remember the chain sorting."

Basically I rolled a poor mans selection sub using the events.

When a "From" Connector is selected the full connection becomes visible all the way back to the beginning connection.
Then upon deselection it hides again, unless being overridden by HideMidLine setting.
Still bugging it out, everynow and then get a selection error, but works pretty good.

jmw_visio

Latest Version
Added a third geometry section for the status indication going back to the Begin Glue when selected. The base geometry section (1) had a habit of changing direction at 1/2 the distance to my label making it look a little weird.
I now have Geometry1 turned off at all times. The geometry3 is now from the label back to the begin, straight. Basically because I just programmed in 2 X,Y Points.
Would like to get it to do routing also, but not sure how to program the Geometry to do this.

Of course upon adding the third Geometry Section the issue with Selection Errors is a little worse, LOL.

Trying several things like Group, Selection properties but no luck. Asked for some ideas in the programming section.

jmw_visio

Latest Version
Added some HMI Enhancement's

Changing the ID on "To" Shape changes the "From" IDs when Synced
Changing the Shape on "To" Shape changes the "From" Shapes when Synced
Right Click Shape Menu
Right Click Horiz Only
Double Click Open Data Props Dialog



jmw_visio

Ok I promise I am not trying to become "Hero Member" with this one thread, LOL!

On this version I have added a right click menu option to the "To" Connector "Add New Connection"

When you click it, a new "From" Connector is dropped on the page and connected to the corresponding "To" connector.
You can then pick the end glue point at the end of the arrow on the "From" and connect it to a shape.

On the Page 2 of this doc, I have placed two rectangle shapes. I have connected a "To" connector on the left shape. If you Right Click Add New Connection, a new "From" is dropped. then connect that glue to one of the sides on the rectangle on the left.
The you can repeat this 3 more times and connect them to each side of the rectangle on the right.

So we now have a "One to Many" Connector Shape System.

jmw_visio

Ok,
one more beta for the day.

I have now made it when you select a "To" Connection all the "From"s connected will highlight.

Of course my invalid selection identifier is really pissing me off now! It happens all the time now.
You cant a stick without 10 of them popping up!
Guess I will try to debug it out this weekend.

Hoping someone has some ideas from my post on it in the Programming section!

Cheers
Mike

jmw_visio

Ok, got the invalid selection bug fixed by checking to make sure there is at least one item selected.
It was in a different Sub from the one where I do the Selection work so I didn't realize it was running.

Here is a version of the masters without the annoying error.

Yacine

Amazing.
But still some bugs.
Adding a connection requires a stencil, you hard coded. The code is better kept in this stencil, this makes deploying easier.
Yacine

jmw_visio

Thanks for the review Yacine.
Yes, I am just in the testing phase. Just adding code to get jobs done and will probably redo from scratch once I get everything I would like to fit it.

Was just starting to decided how to handle the code/stencil/distribution part.

New to Visio development.

I of course would like it to be distributed easily.

Since it is two master shapes, I figure a stencil is the easiest distribution method.
Will be trying to work on moving code to the stencil.

Any advice/ideas on this from you guys would be great.

I think moving the connection logic Sub into a Stencil will be easy.

But the Event code Subs are a little more Visio specific so not sure I can move them.

Any ideas on what to do with those subs would be greatly appreciated.



Yacine

Not sure about this, but I think you need to implement a variable that stands for the page (or the document?).
This can be done by either starting a macro from the stencil manually , or on load. Mind that the variable is lost when the macro crashes.
Then you can set up an event catcher (selection changed) and do the stuff that needs to be done.
Yacine