Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Dynamic Node Creation (Read 3751 times)
hollywood
YaBB Newbies
*
Offline


Total Noob

Posts: 11
Joined: Jul 10th, 2007
Dynamic Node Creation
Aug 1st, 2007 at 6:46pm
Print Post  
I want to create and display nodes in the nodesLST (FlowChart sample) dynamically. I am passing an object that contains multiple nodes (including the anchors). and I just want to iterate through the object and display them.

Has someone done this and can you share?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Dynamic Node Creation
Reply #1 - Aug 2nd, 2007 at 5:50am
Print Post  
Do you mean the shapes list in the Flowcharter example? Instead of creating items in a hidden flowchart and exporting to a bitmap, you could use the nodes' Draw method to draw them directly on a Graphics, e.g. when handling the listbox' DrawItem event.

The boolean argument of that method specifies whether to draw the node's shadow, or the node itself. So call Draw(g, true) once to draw the shadow and next call Draw(g, false) to draw the item, or just call Draw(g, false) to draw a node without a shadow.

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


Total Noob

Posts: 11
Joined: Jul 10th, 2007
Re: Dynamic Node Creation
Reply #2 - Aug 2nd, 2007 at 11:56am
Print Post  
I want to dynamically load the node list that displays the shapes that I can drag onto my pallet. Where Alternative, Card, Decision, Delay, etc are, I want to dynamically load my nodes. I have an object loaded with the nodes that I want to load.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Dynamic Node Creation
Reply #3 - Aug 2nd, 2007 at 12:05pm
Print Post  
If you are using the Flowcharters's listbox implementation, just add your shapes to the _nodes array instead of the one currently there. If using the standard ShapeListBox, set its Shapes property to a list of the shapes you want to display.

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


Total Noob

Posts: 11
Joined: Jul 10th, 2007
Re: Dynamic Node Creation
Reply #4 - Aug 2nd, 2007 at 12:39pm
Print Post  
Thanks. Each node in my object contains information on the number/placement of input/output anchors. I am calculating the positions of those anchors and need to dynamically specify them as well.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Dynamic Node Creation
Reply #5 - Aug 2nd, 2007 at 12:47pm
Print Post  
Ok, then use the nodes from your object as drag-and-drop data objects, and in the DragDrop event handler set the box' AnchorPattern to one corresponding to your anchor points.

Stoyan
  
Back to top
 
IP Logged
 
hollywood
YaBB Newbies
*
Offline


Total Noob

Posts: 11
Joined: Jul 10th, 2007
Re: Dynamic Node Creation
Reply #6 - Aug 2nd, 2007 at 1:03pm
Print Post  
I'll check that out. Thanks a bunch!  Cheesy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint