Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Drag/Drop (grid-aligned); Default drawing behavior (Read 3057 times)
jonsberndt
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Sep 18th, 2008
Drag/Drop (grid-aligned); Default drawing behavior
Oct 9th, 2008 at 3:25am
Print Post  
Two questions:

1) When a shape is dropped onto a diagram, is it possible to automatically make sure that the shape is aligned to the grid? I think I can do that algorithmically myself, but I was wondering if there is a property setting that handles this itself?

2) I'd like to make sure that the default diagram behavior (when the mouse drags a rectangle on the diagram) is that nothing at all happens. Right now, a shape object is drawn, but I'd like nothing to happen.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag/Drop (grid-aligned); Default drawing beha
Reply #1 - Oct 9th, 2008 at 7:50am
Print Post  
1) You could call the Diagram.AlignPointToGrid method to find out which grid point is nearest to the mouse position, and call DiagramNode.Move to move the node there.

2) Set DiagramView.Behavior = DoNothing.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
jonsberndt
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Sep 18th, 2008
Re: Drag/Drop (grid-aligned); Default drawing beha
Reply #2 - Oct 10th, 2008 at 1:56am
Print Post  
Stoyo wrote on Oct 9th, 2008 at 7:50am:
1) You could call the Diagram.AlignPointToGrid method to find out which grid point is nearest to the mouse position, and call DiagramNode.Move to move the node there.

2) Set DiagramView.Behavior = DoNothing.

I hope that helps,
Stoyan


Well, the current Behavior is LinkShapes, which is good, since I can then link shapes that are already in the view. However, if I depress the left mouse button while the cursor is not over a shape, then the behavior is to draw a shape. I only want to prevent that latter behavior, not the linking.

Jon
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag/Drop (grid-aligned); Default drawing beha
Reply #3 - Oct 10th, 2008 at 6:34am
Print Post  
Set DiagramView.Behavior = DrawLinks.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
jonsberndt
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Sep 18th, 2008
Re: Drag/Drop (grid-aligned); Default drawing beha
Reply #4 - Oct 11th, 2008 at 4:12am
Print Post  
Stoyo wrote on Oct 10th, 2008 at 6:34am:
Set DiagramView.Behavior = DrawLinks.

I hope that helps,
Stoyan


Yes, that's exactly what I was looking for.

I have to say it (or, *write* it!): FlowChart.NET is a really impressive piece of work!

Jon Berndt
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag/Drop (grid-aligned); Default drawing beha
Reply #5 - Oct 12th, 2008 at 9:51am
Print Post  
Thanks 8)
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint