Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Bounds property (Read 1658 times)
gringogordo
YaBB Newbies
*
Offline


Flowcharting is my life
baby

Posts: 12
Joined: Nov 13th, 2007
Bounds property
Mar 7th, 2008 at 3:14pm
Print Post  
Hi,

I'm sure I'm being a bit slow on this buit I'm trying to format my diagram and I'm doing this by setting a nodes postion in relation to its parents position. 

Obvioulsy I can store this myself but I was hoping to use the bounds property on the parent node.  Unfortunately this seems to be giving a different set of numbers back from those used to create the diagramnode.  so for example I'm starting off at X=400, Y=400 and when I get the node programatically and look at its bounds it tells me it's at X= 105, Y=53.   When I pass these back (+ a little on the Y param) into the creation of a new desitination diagram it is created above and to the left !

Does anyone know what I'm missing here?



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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Bounds property
Reply #1 - Mar 7th, 2008 at 3:34pm
Print Post  
Hi,

Are you using groups / the AttachTo method? In that case, moving one node would move the attached nodes too, changing their initial Bounds value. Or they could move if you call the Arrange method of some layout class after setting Bounds?

Stoyan
  
Back to top
 
IP Logged
 
gringogordo
YaBB Newbies
*
Offline


Flowcharting is my life
baby

Posts: 12
Joined: Nov 13th, 2007
Re: Bounds property
Reply #2 - Mar 7th, 2008 at 3:45pm
Print Post  
No,

It's all in the same procedure.  I have a set of objects in a database which I am using to build a diagram.

I set the first one

Dim oPointF As PointF = oView.ClientToDoc(New Point(400, 100))
oShape = oDiagram.Factory.CreateShapeNode(oPointF.X, oPointF.Y, 20, 10)

and then in the sampe procedure iterate through until I get the node with the correct tag (set to an id)

For Each oParentNode As ShapeNode In oDiagram.Nodes
                       If CType(oParentNode.Tag, Int32) = Id Then

grab node and get
oParentNode.bounds.top & left (or X & Y)
and these are  different to the values just used to set the parent diagram ?!

Cheers.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Bounds property
Reply #3 - Mar 7th, 2008 at 3:56pm
Print Post  
ClientToDoc converts pixels to the diagram's MeasureUnit, so the Bounds top/left point won't be located at 400,100 in the diagram coordinate system. Additionally, the value returned by ClientToDoc depends on the current scroll position and zoom factor, so you could get different results depending on whether the diagram is zoomed or scrolled. If you need to convert from pixels to MeasureUnit without considering the scroll position, subtract ScrollX and ScrollY from the ClientToDoc result.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint