Adding New Elements

Hi,
I want to use icon based node element in left pallete in Flow Chart like application and each node element should associate with a nodeID (not partID).
I want that admin have a facility for adding new network icon.It does not need for go to programmer many times for adding every new node in pallete.

The
capability to have more network elements added to the left pane (like a
gallery of elements) without the need of modifying source code each time
must be available so that more network elements can be added at run time
(or via configuration through the config file) without having to change
code for everything.

You can do that. Our samples just drop parts in the palette by creating the objects and sticking them in the palette, but you can certainly read the parts for the palette out of an XML file or database.

Then you provide the admin with the ability to add elements to that data.
DataSetDemo shows one way of mapping data rows into Nodes.

I am not getting to how to do this.
Can u plz provide a sample module for this.

First of all, a GoPalette is just a GoView with some special behavior. It displays the GoObjects you Add to the view.Document.
From the GoDiagram FAQ:

How do I put things in a palette so that users can drag from there into a view?

Use the GoPalette class. Into the palette’s Document just add instances of each kind of node that you want your users to be able to drag and drop. You can control the Orientation and GridCellSize and alignment, as well as whether the items are sorted and in what order with the Sorting property. You can even turn off the automatic positioning of items in the palette’s document by setting the AutomaticLayout property to false. In addition, all of the standard GoView properties apply, although many have already been turned off by calling SetModifiable(false), so that users do not modify the palette or its contents.

When the user drops a GoObject into a view, the view’s document’s GoDocument.CopyFromCollection method is called to copy the object into the document. If you need to adjust the dropped object(s) in some way, you should add a GoView.ExternalObjectsDropped event handler to modify the object(s) in the GoView.Selection.

----------------
Here's the code that adds the parts to the Flowcharter sample GoPalette:
[code]
private void InitializeCatalog() {
GoComment c = new GoComment();
c.Text = "Enter your comments here";
myPalette.Document.Add(c);
GraphNode n;
n = new GraphNode(GraphNodeKind.Start);
myPalette.Document.Add(n);
n = new GraphNode(GraphNodeKind.Step);
myPalette.Document.Add(n);
...
}
[/code]
The red code adds a GoComment... the blue adds a "Start" GraphNode.
The GraphNode is a good example here, since it is a single node that knows how to "look" like multiple different types of nodes (although in this case, that happens to be a hard-coded list of types). The node (or nodes) you define in your app have to be extensible to allow adding new ones from data. That might be "a node with an icon of a router box", where the only customizable attribute is the icon.
Again, if you look at GraphNode, here is the code that makes it be a "Start" node...
[code]
// (note: this may be v3 specific code here)
case GraphNodeKind.Start: {
this.Text = "Start";
this.Background = new GoDrawing(GoFigure.RoundedRectangle);
((GoDrawing)(this.Background)).FillShapeHighlight(first, second);
this.TopLeftMargin = new SizeF(10, 5);
this.BottomRightMargin = new SizeF(10, 5);
UpdatePorts("", "o", "o", "o");
break;
}
[/code]
The Label, Background, Fill, Margins and Port locations are all "attributes" of the node that might be stored in a data file that defined what sorts of objects to add to the palette. There are certainly others you can think of ... pen color, brush color, internal part ID, options that control the Node's behavior after it is dropped in the view... etc.
GoDrawing is not accessible.
and one more thing I want to add here "abc.ico" like icon in pallete.
not want it comes from coding (i.e. in GraphNode.cs).

Please suggest me in this way.

Parts of GoDrawing are in 2.x, but it is an undocumented interface. More will be in v3 (as the code above illustrates). The code above wasn’t something you can drop into a 2.x application…

abc.ico would just be another parameter you would read from the palette description and set when you create the GoSimpleNode or GoGeneralNode (or whatever node you have that has an icon).
[code]
// ... read in iconpath, topLabel, bottomLabel, portsOnLeft, portsOnRight from Palette definition file...
GoGeneralNode gn = new GoGeneralNode();
gn.Initialize(null, iconpath, topLabel, bottomLabel, portsOnLeft, portsOnRight);
[/code]

can u plz tell me when I will be able to get v3.
because this requirement is necessary or us.

V3 just makes this a little easier. You can do everything you want to do with 2.6. Here’s the same code snippet from the V2 samples:

case GraphNodeKind.Start: {
this.Background = new GoRoundedRectangle();
this.Background.Selectable = false;
this.TopPort = null;
this.RightPort.IsValidTo = false;
this.BottomPort.IsValidTo = false;
this.Text = "Start";
break;
}
This code is from GraphNode.cs in the Flowcharter sample... you should look at that in detail to see how other "GraphNodeKind" nodes are created.

<span style=“font-size: 10pt; font-family: “MS Shell Dlg 2”; color: black;”>In Flowcharter, sample elements are coming at Design time.

But <span style=“font-size: 10pt; font-family: “MS Shell Dlg 2”; color: black;”>I want the capability to
have end users to create their own elements in left pane at Run time rather than Design time.

basically I want that left pane be similar to visual studio tool box and as we add control here with choosing dll it add new element in left pane
<span style=“font-size: 10pt; font-family: “MS Shell Dlg 2”; color: black;”>
can u give brief sample…<o:p></o:p>

This is urgent for me.

Hi Jake,
We would like to buy this product soon.But we would like to get its latest version.so that it fulfill our all requirements.
We are waiting for this latest version (ver 3.0) .Can u please tell me how soon u are publishing this latest version.

<SPAN =“281154512-19112007”>If you buy now (with support / subscription), you’ll get 3.0 when it comes out. We don’t have a date for 3 yet, but we’re getting close to beta.