Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Flowcharter (Read 6528 times)
SC
YaBB Newbies
*
Offline



Posts: 37
Joined: Jan 18th, 2008
Flowcharter
Jun 3rd, 2008 at 6:39pm
Print Post  
What is the equivalent of flowcharter project in WPFdiagram? I am trying to use drag and drop images functionality
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Flowcharter
Reply #1 - Jun 3rd, 2008 at 6:48pm
Print Post  
A WPF version of Flowcharter is not available yet. Drag-and-drop of images is shown in the FCDemo sample:

void diagram_Drop(object sender, System.Windows.DragEventArgs e)
  {
       Point p = e.GetPosition(diagram);
       Point pt = diagram.ClientToDoc(p);
           
       if (e.Data.GetDataPresent(typeof(Image)))
       {
               Image i = (Image)e.Data.GetData(typeof(Image));
               ShapeNode b = diagram.Factory.CreateShapeNode(pt.X, pt.Y, 10, 10);
               b.Image = i.Source as BitmapSource;
               b.ResizeToFitImage();
               b.Transparent = true;
       }
       ...
}

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



Posts: 37
Joined: Jan 18th, 2008
Re: Flowcharter
Reply #2 - Jun 3rd, 2008 at 8:12pm
Print Post  
FCDemo project is complainig that
"No working project exist in D:\projects...

How to fix that?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Flowcharter
Reply #3 - Jun 4th, 2008 at 8:58am
Print Post  
In the project properties window, Debug tab, clear the "Working directory" text field content.
  
Back to top
 
IP Logged
 
SC
YaBB Newbies
*
Offline



Posts: 37
Joined: Jan 18th, 2008
Re: Flowcharter
Reply #4 - Jun 4th, 2008 at 5:13pm
Print Post  
How can I replicate the hierarchy that I have drawn on WPFcanvas to treeview?

I am trying to show the objects relation that is being drawn on canvas to reflect in treeview.

Existing Overview is not expanding particular content. I wanted to create tables with inputs and putputs and when I zoomin on the that particular tables that table alone needs to be zoom in and at that point I want to draw a line from on of the columns to the other tables. I need this as I have lot of columns in my table drawing and I do not want to show that big list all the time. I need this for map from Table to Table B.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Flowcharter
Reply #5 - Jun 4th, 2008 at 7:25pm
Print Post  
Try this -

Code
Select All
void BuildTree(DiagramNode diagramNode, TreeViewItem treeItem)
{
	foreach (DiagramLink link in diagramNode.OutgoingLinks)
	{
		DiagramNode childNode = link.Destination;
		TreeViewItem childItem = new TreeViewItem();
		childItem.Header = (childNode as InplaceEditable).GetTextToEdit();
		treeItem.Items.Add(childItem);
		BuildTree(childNode, childItem);
	}
}

void ToTreeView(DiagramNode rootNode, TreeView treeView)
{
	TreeViewItem rootItem = new TreeViewItem();
	rootItem.Header = "root";
	treeView.Items.Add(rootItem);
	BuildTree(rootNode, rootItem);
}
 



If you are using TableNodes whose ConnectionStyle is set to Rows or Both, you might also have to iterate over the OutgoingLinks of each table row.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Flowcharter
Reply #6 - Jun 4th, 2008 at 7:37pm
Print Post  
This BuildTree version should work fine with table row connections:

Code
Select All
void BuildTree(DiagramNode diagramNode, TreeViewItem treeItem)
{
	DiagramLinkCollection allOutLinks = diagramNode.OutgoingLinks.Clone();
	TableNode tableNode = diagramNode as TableNode;
	if (tableNode != null)
	{
		foreach (TableNode.Row row in tableNode.Rows)
			foreach (DiagramLink link in row.OutgoingLinks)
				allOutLinks.Add(link);
	}

	foreach (DiagramLink link in allOutLinks)
	{
		DiagramNode childNode = link.Destination;
		TreeViewItem childItem = new TreeViewItem();
		childItem.Header = (childNode as InplaceEditable).GetTextToEdit();
		treeItem.Items.Add(childItem);
		BuildTree(childNode, childItem);
	}
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Flowcharter
Reply #7 - Jun 4th, 2008 at 7:43pm
Print Post  
Can't you implement the zooming function by changing the table.Bounds.Width and showing / hiding the links between the two tables?
  
Back to top
 
IP Logged
 
SC
YaBB Newbies
*
Offline



Posts: 37
Joined: Jan 18th, 2008
Re: Flowcharter
Reply #8 - Jun 4th, 2008 at 10:33pm
Print Post  
I needed to be able to edit the inputs or text during Zoom function.
DO you have any collapse expand inputs feature sample in wpf? Also help says check Iconnode for custom node creation but there is iconnode project in wpf, it was there in earlier versions.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Flowcharter
Reply #9 - Jun 5th, 2008 at 11:16am
Print Post  
You could let users collapse the table to its caption area and expand it back by double-clicking, for example:

Code
Select All
private void diagram_NodeDoubleClicked(object sender, NodeEventArgs e)
{
	TableNode table = e.Node as TableNode;
	if (table != null)
	{
		// Check if the caption has been clicked
		if (e.MousePosition.Y - table.Bounds.Y < table.CaptionHeight)
		{
			// The caption is clicked -> Expand / Collapse table
			bool expanded = false;
			if (table.Tag == null)
			{
				expanded = true;
			}
			else if (table.Tag is float)
			{
				if ((double)table.Tag == 0)
					expanded = true;
			}
			else if (!(table.Tag is double))
			{
				expanded = true;
			}

			if (expanded)
			{
				table.Tag = table.Bounds.Height;
				Rect rc = table.Bounds;
				rc.Height = table.CaptionHeight;
				table.Bounds = rc;
			}
			else
			{
				Rect rc = table.Bounds;
				rc.Height = (double)table.Tag;
				table.Bounds = rc;
				table.Tag = null;
			}
		}
	}
}
 



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