Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Get The source anchor (link) from Tablenode (Read 4206 times)
SavyCat
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 38
Joined: Sep 4th, 2007
Get The source anchor (link) from Tablenode
Sep 5th, 2007 at 1:20pm
Print Post  
Hi guys, I have another question. Ive been searching for quite a while now, but can't understand how to do what im trying to do.

Basically, I need to get the source anchor from a link created between two tables. Ideally, I need to find out the selected row index of the source table.

I read in one of the forum topics that there is a function, but its in the source code or something like that.

Any ideas?
Thanks guys

ps. awesome software  Grin
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get The source anchor (link) from Tablenode
Reply #1 - Sep 5th, 2007 at 3:27pm
Print Post  
Hi,

If you are using the Rows connection style, the OriginIndex and DestinationIndex properties of DiagramLink let you find out which table rows are connected by a link. If you have an AnchorPattern set for a table, use the OriginAnchor and DestinationAnchor to find out the related anchor points.

Quote:
ps. awesome software Grin


Thanks 8)

Stoyan
  
Back to top
 
IP Logged
 
davidl
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 13
Joined: Dec 3rd, 2007
Re: Get The source anchor (link) from Tablenode
Reply #2 - Dec 3rd, 2007 at 5:37pm
Print Post  
Hi,

I am working with the Entites sample code which creates TableNodes and DiagramLinks.  The connection style of the tablenode is set to Rows, but the info I see for DestinationIndex, OriginIndex, DestinationAnchor and OriginAnchor all seems to be garbage.  Is there something else I need to do? Do I need to set these properties in the LinkActivated event?

Thanks for any help.
David
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get The source anchor (link) from Tablenode
Reply #3 - Dec 4th, 2007 at 6:25am
Print Post  
Hi,

I have added the following event handler to the Entities sample and the values seem ok.

Code
Select All
private void diagram_LinkDoubleClicked(object sender, MindFusion.Diagramming.LinkEventArgs e)
{
	MessageBox.Show(
		"origin row: " + e.Link.OriginIndex.ToString() + "\n" +
		"origin anchor: " + e.Link.OriginAnchor.ToString() + "\n" +
		"dest row: " + e.Link.DestinationIndex.ToString() + "\n" +
		"dest anchor: " + e.Link.DestinationAnchor.ToString() + "\n");
}
 



Have you changed anything in the sample source code? The values of these properties might not be set yet when some events are raised, e.g. LinkCreating or InitializeLink; are you accessing these properties from any of these events' handlers?

Stoyan
  
Back to top
 
IP Logged
 
davidl
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 13
Joined: Dec 3rd, 2007
Re: Get The source anchor (link) from Tablenode
Reply #4 - Dec 4th, 2007 at 12:23pm
Print Post  
Stoyan,

Thanks for your reply.

Yes, I have made quite a few changes to the sample source - none that I thought would effect these properties, but apparrenlty I have.  I will back out my changes and see what has caused the problem - I'll let you know when I find out.

-David
  
Back to top
 
IP Logged
 
davidl
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 13
Joined: Dec 3rd, 2007
Re: Get The source anchor (link) from Tablenode
Reply #5 - Dec 4th, 2007 at 3:30pm
Print Post  
Stoyan,

I tried to change the sample code to support more than 1 output, but I can't seem to get it right.

If you add the following code to the bottom of the addBtn_Click(...) function in AddEntityForm.cs, you'll have essentially the same code as I:

          for (int i = 0; i < _input.Length; i++)
           {
               _input[i] = "in" + i;
               _output[i] = "out" + i;
           }

As you can see this populates the input and output string arrays (without any user input) and causes the app to draw a table with 3 inputs and 3 outputs.  Everything looks good -  the text, the images, the anchors, etc.  But the output index is 1 for all 3 outputs.

Am I missing something simple? Perhaps the way the table is instantiated?  Thanks for any help - this is driving me crazy!

-David


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get The source anchor (link) from Tablenode
Reply #6 - Dec 4th, 2007 at 3:59pm
Print Post  
There was a bug in the original 5.0 release that caused a similar problem. Please check if this will work better with the latest version 5.0.1:

https://mindfusion.eu/FCNetDemo.zip

Stoyan
  
Back to top
 
IP Logged
 
davidl
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 13
Joined: Dec 3rd, 2007
Re: Get The source anchor (link) from Tablenode
Reply #7 - Dec 4th, 2007 at 5:54pm
Print Post  
Stoyan,

Yes, that seems to have solved the problem.  Thanks for your help.

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