Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic GetNodeAt() problems (Read 2808 times)
brianh
YaBB Newbies
*
Offline



Posts: 30
Joined: Jul 1st, 2008
GetNodeAt() problems
Jul 8th, 2008 at 10:54am
Print Post  
Hi,

I have found that when I call GetNodeAt() when processing mouse moves it DOES return a node at the supplied point, but it returns the first one created, NOT the one on top!

The help says it returns the top-most node at the specified point according to the Z-order.  So my question is, when I select a node, and it moves obove the other nodes on the diagram, does this not also move it's z-order position to the top?

This problem is not only in my code, but can also be seen in the 'Class-hierarchy diagram' demo.  If you move the 'String' class node a little so that it's on a grid point, then move the 'IntList' class node exactly on top of it (so that the 'methods' expansion button is on top of the one for the 'String' class), and then click the expansion button on the 'IntList' node, the 'String' node will expand and collapse!

How can I fix this?

Thanks.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: GetNodeAt() problems
Reply #1 - Jul 8th, 2008 at 11:48am
Print Post  
Hi,

You might disable SelectionOnTop so that nodes are always rendered according to their ZIndex. Otherwise you could bring the selected nodes to the top of the Z order from a handler of the SelectionChanged or NodeSelected events. Another option is to use ContainsPoint to check whether selected nodes contain the point before calling GetNodeAt.

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



Posts: 30
Joined: Jul 1st, 2008
Re: GetNodeAt() problems
Reply #2 - Jul 8th, 2008 at 2:11pm
Print Post  
Hi Stoyan,

I have now hooked into the NodeSelected event as you suggested, and set the newly selected node to the top of the z-order (and all it's child nodes, which I'm using as buttons,  above that).  Now when one node is on top of another, I can click on the buttons and the correct node handles the clicks.

But, when I click on the expansion button in the tree, it still expands/collapses the one underneath! Sad

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: GetNodeAt() problems
Reply #3 - Jul 8th, 2008 at 3:04pm
Print Post  
Hi Brian,

Ok, we haven't foreseen that situation. We'll have to enumerate the items in reverse of the Z order when hit-testing the +/- icons - we are starting beta tests for v5.1 tomorrow, and will try to fix that for the tomorrow's build.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: GetNodeAt() problems
Reply #4 - Jul 9th, 2008 at 9:23am
Print Post  
This version should hit test the +/- buttons in the correct order and also fixes the AutoDeleteItems problem:
https://mindfusion.eu/_beta/fcnet51.zip

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



Posts: 30
Joined: Jul 1st, 2008
Re: GetNodeAt() problems
Reply #5 - Jul 10th, 2008 at 1:31pm
Print Post  
Hi Stoyan,

Thanks for the quick response, but I have the demo version at the moment, so will these dlls work with that, or do I need to download another demo?

Thanks.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: GetNodeAt() problems
Reply #6 - Jul 10th, 2008 at 3:11pm
Print Post  
Hi Brian,

You only need to overwrite the assemblies referenced by your project with the ones from the zip file. If you get a build error that mentions LC.EXE, edit licenses.licx and set PublicKeyToken=null at the end of the Flowchart.NET entry there.

Stoyan
  
Back to top
 
IP Logged
 
brianh
YaBB Newbies
*
Offline



Posts: 30
Joined: Jul 1st, 2008
Re: GetNodeAt() problems
Reply #7 - Jul 10th, 2008 at 3:25pm
Print Post  
Thanks, that works fine, and the problem is fixed! Smiley

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