Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Rename Node (Read 2659 times)
Amx
YaBB Newbies
*
Offline


digito ergo sum

Posts: 21
Joined: Jan 19th, 2010
Rename Node
Jan 22nd, 2010 at 2:35pm
Print Post  
Hi,
I need to implement a feature that allow user to rename a node by clicking on it once, but I haven't found any similar option in the Programmer's Guide. It's possible to interactively change name to nodes (and also to links)?

Best Regards,
Amx
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Rename Node
Reply #1 - Jan 22nd, 2010 at 3:12pm
Print Post  
Hi,

Call diagram.BeginEdit() in response to NodeClicked or LinkClicked.

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


digito ergo sum

Posts: 21
Joined: Jan 19th, 2010
Re: Rename Node
Reply #2 - Jan 22nd, 2010 at 3:28pm
Print Post  
exactly what I was looking for... Wink

many thanks Stoyan,
Amx
  
Back to top
 
IP Logged
 
Amx
YaBB Newbies
*
Offline


digito ergo sum

Posts: 21
Joined: Jan 19th, 2010
Re: Rename Node
Reply #3 - Feb 4th, 2010 at 10:33am
Print Post  
Hi,

I would implement that behaviour: The node is Selected only when I click and must enter in Edit mode only if i click a node previously selected. In practice, I must click two time (no double click) on a node to enter Edit mode but If I use BeginEdit when NodeClicked is raised, the property Selected on ActiveItem is ever true.

The top will be a "NodeClicking" event... how simulate that?

Thank's,
Amx

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Rename Node
Reply #4 - Feb 4th, 2010 at 12:40pm
Print Post  
Hi,

Yes, it seems that would be useful in such situations. You might simulate it with the Selecting event:

Code
Select All
private void OnNodeClicked(object sender, NodeEventArgs e)
{
	if (e.Node == diagram.ActiveItem && clickCounter > 0)
		diagram.BeginEdit(e.Node as InplaceEditable);
	clickCounter++;
}

private void OnNodeSelecting(object sender, NodeValidationEventArgs e)
{
	if (!e.Node.Selected)
		clickCounter = 0;
} 



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