Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Get Grid Position of Nodes? (Read 5748 times)
mbuechler
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 39
Joined: Oct 21st, 2009
Get Grid Position of Nodes?
Apr 21st, 2010 at 7:07am
Print Post  
Hi.

I have a diagram with several ControlNodes. For these ControlNodes I would like to save the Position in the underlying grid. Do I have the possibility to get the actual Position of an Item/node on the grid?

Thanks a lot.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get Grid Position of Nodes?
Reply #1 - Apr 21st, 2010 at 7:28am
Print Post  
Hi,

You can get a node's position through its Bounds property. If you need to get the underlying cell of the lanes grid, call the grid's GetCellFromPoint method.

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


I love YaBB 1G - SP1!

Posts: 39
Joined: Oct 21st, 2009
Re: Get Grid Position of Nodes?
Reply #2 - Apr 21st, 2010 at 7:38am
Print Post  
Hi thanks for the answer.
But how do I get the grid from my diagram? I can only find :
diagram1.GridColor
diagram1.GridOffsetX
diagram1.GridOffsetY
diagram1.GridSizeX
diagram1.GridSizeY
diagram1.GridStyle

I mean the grid which helps the user to position the several Items. I do not mean any table,...

Thanks again
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get Grid Position of Nodes?
Reply #3 - Apr 21st, 2010 at 8:03am
Print Post  
It seems you are not using the LanesGrid then? If you need to determine where in the alignment grid (as column and row) some item is located, you can do that by subtracting the respective GridOffsetX/Y property from the item's position and dividing the result by GridSizeX/Y.

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


I love YaBB 1G - SP1!

Posts: 39
Joined: Oct 21st, 2009
Re: Get Grid Position of Nodes?
Reply #4 - Apr 21st, 2010 at 8:43am
Print Post  
Ah ok.
So there is no easy way to say "GetGridPosition", save this infos, and on loading the flowchart again say "SetGridPosition" for the Objects.
OK so I have to save X/Y Location...
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get Grid Position of Nodes?
Reply #5 - Apr 21st, 2010 at 9:46am
Print Post  
You can save and restore X and Y from node.Bounds. There wouldn't be much difference from storing columns and rows, except that X and Y are float values.

Stoyan
  
Back to top
 
IP Logged
 
mbuechler
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 39
Joined: Oct 21st, 2009
Re: Get Grid Position of Nodes?
Reply #6 - Apr 22nd, 2010 at 8:35am
Print Post  
Ok I See.

Another Question is: I changed measure Unit of the diagram to Pixel, and now the Handles for resizing an item are very small. Where can I change Handlesize? Is it a property on the items or on the diagram.

Thanks again.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get Grid Position of Nodes?
Reply #7 - Apr 22nd, 2010 at 9:06am
Print Post  
There's the Diagram.AdjustmentHandlesSize property.
  
Back to top
 
IP Logged
 
mbuechler
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 39
Joined: Oct 21st, 2009
Re: Get Grid Position of Nodes?
Reply #8 - Apr 22nd, 2010 at 9:17am
Print Post  
Ah ok. Thats what I need. Thanks.
Is there also a posibility to enlarge the "border" with what you can move the item?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get Grid Position of Nodes?
Reply #9 - Apr 22nd, 2010 at 10:06am
Print Post  
I think it is always set to half the AdjustmentHandlesSize at this time; there's no additional property to change just its size.
  
Back to top
 
IP Logged
 
mbuechler
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 39
Joined: Oct 21st, 2009
Re: Get Grid Position of Nodes?
Reply #10 - May 3rd, 2010 at 8:53am
Print Post  
Thanks a lot.

I have another question about Links. Is there a property for a offset the links have? An offset between the anchor an the link itself? My problem is that a part of the head of the link is not shown. It is hidden by the Node where it is assinged to.

Thanks again
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get Grid Position of Nodes?
Reply #11 - May 3rd, 2010 at 9:01am
Print Post  
Call link.ZTop to move the head in front of the node. Otherwise you might try placing the anchor points a bit outside the node borders, or explicitly set ControlPoints[0] and ControlPoints[count - 1].

I hope that helps, 
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint