Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic On the diagram to select multiple objects do to appear an edit box instead of multiple (Read 2505 times)
Joe
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Jun 6th, 2012
On the diagram to select multiple objects do to appear an edit box instead of multiple
Jan 11th, 2013 at 2:21am
Print Post  
On the diagram to select multiple objects do to appear an edit box instead of multiple
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: On the diagram to select multiple objects do to appear an edit box instead of multiple
Reply #1 - Jan 11th, 2013 at 6:51am
Print Post  
Are you asking how to show an edit box after selecting multiple objects?
  
Back to top
 
IP Logged
 
Joe
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Jun 6th, 2012
Re: On the diagram to select multiple objects do to appear an edit box instead of multiple
Reply #2 - Jan 12th, 2013 at 9:30am
Print Post  
yes

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: On the diagram to select multiple objects do to appear an edit box instead of multiple
Reply #3 - Jan 14th, 2013 at 7:42am
Print Post  
You could add an edit box to the diagram as a node and place it at the location of the selection rectangle:

Code
Select All
DiagramNodeAdapter editNode;

private void OnSelectionChanged(object sender, EventArgs e)
{
	if (editNode == null && diagram.Selection.Items.Count > 1)
	{
		var editBox = new TextBox();
		editNode = new DiagramNodeAdapter(diagram, editBox);
		editNode.SizeSyncMode = SizeSyncMode.SetSize;
		diagram.Nodes.Add(editNode);
		editNode.Bounds = diagram.Selection.Bounds;
		diagram.SelectionOnTop = false;
		editBox.Focus();
	}
} 



Then remove the node when the diagram is clicked, or from other event handler such as KeyDown raised for Esc or Enter keys in the edit box.

Code
Select All
private void OnDiagramClicked(object sender, DiagramEventArgs e)
{
	if (editNode != null)
	{
		diagram.Nodes.Remove(editNode);
		editNode = null;
	}
} 



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