Modification of GoTextNode

I am currently attempting to modify GoTextNode to something that resembles the image linked below:

The grey area is the GoTextNode.Label, each item in the green area (Tax Exempt, Balance) are going to end up being seperate GoPort objects, and the items in the red area are each going to be seperate GoPort objects.
I was curious if you guys could help point me in the correct direction in modifying the GoTextNode to resemble and function how I would like?
Best regards,
Mark Stahl

I suggest you use the RecordNode example class that is in Demo1. That’s based on GoMultiTextNode (which is oriented towards multiple items, each with one or two ports), not on GoTextNode (which has only a single item).

I took a look at the record node, and also examined the properties. I didn’t see many properties for the lines seperating the records (even just turning them on or off).

Now would it be possible to over a N number of inports, give them a certain color and draw a line, and then interate over a set of M number of outports, and give them a seperate color; without rewriting the functionality of most of the class? (I do realize some drawing methods may have to be overridden).
Or rather, let me just ask frankly, what would be your recommended approach to displaying this node, in this fashion?
Best regards,
Mark Stahl

[code] [Serializable]
public class CustomMultiTextNode : GoMultiTextNode {
public CustomMultiTextNode() {
this.TopLeftMargin = new SizeF(0, 0);
this.BottomRightMargin = new SizeF(0, 0);
this.LinePen = null;
GoText header = AddString(“Account”, Color.LightGray);
header.Alignment = Middle;
AddSeparator();
this.ItemWidth = 100;
}

// helper methods
public virtual GoText AddString(String s, Color c) {
GoText lab = base.AddString(s);
lab.TransparentBackground = false;
lab.BackgroundColor = c;
return lab;
}
public virtual GoShape AddSeparator() {
GoStroke s = new GoStroke();
s.Selectable = false;
s.AddPoint(0, 0);
s.AddPoint(1, 0);
AddItem(s, null, null);
return s;
}
}[/code]
Example use:
[code] CustomMultiTextNode mtn = new CustomMultiTextNode();
mtn.AddString("Tax Exempt", Color.LightCyan);
mtn.AddString("Balance", Color.LightCyan);
mtn.AddSeparator();
mtn.AddString("GetTaxExempt", Color.LightPink);
mtn.AddString("GetBalance", Color.LightPink);
mtn.AddString("AdjustBalance", Color.LightPink);
doc.Add(mtn);[/code]

Thank you Walter for all of your quick and informative replies. This has to be, by far, some of the best support I have every received.

Flattery aside, I have another question for, and it regards the reordering of the items within a multi-text node (more specifically the record node):
From my earlier replies in this post, we would like to keep the colors together even when a new item is added, or when an item is removed.
Does the multitext node have specific functionality to support the reordering of items based on some specified criteria, and do we have to something special in order to make sure the GoPort stay with their appropriate item.
Best regards,
Mark

[code] [Serializable]
public class CustomMultiTextNode : GoMultiTextNode {
public CustomMultiTextNode() {
this.TopLeftMargin = new SizeF(0, 0);
this.BottomRightMargin = new SizeF(0, 0);
this.LinePen = null;
GoText header = AddString(“Account”, Color.LightGray);
header.Alignment = Middle;
AddSeparator();
this.ItemWidth = 100;
}

public virtual GoText AddString(String s, Color c) {
  GoText lab = base.AddString(s);
  lab.TransparentBackground = false;
  lab.BackgroundColor = c;
  return lab;
}
public virtual GoText InsertString(int i, String s, Color c) {
  GoText lab = base.InsertString(i, s);
  lab.TransparentBackground = false;
  lab.BackgroundColor = c;
  return lab;
}

public virtual GoShape AddSeparator() {
  GoStroke s = new GoStroke();
  s.Selectable = false;
  s.AddPoint(0, 0);
  s.AddPoint(1, 0);
  AddItem(s, null, null);
  return s;
}
public virtual GoShape InsertSeparator(int i) {
  GoStroke s = new GoStroke();
  s.Selectable = false;
  s.AddPoint(0, 0);
  s.AddPoint(1, 0);
  InsertItem(i, s, null, null);
  return s;
}

public virtual int FindString(String s) {
  for (int i = 2; i < this.ItemCount; i++) {
    GoText t = GetItem(i) as GoText;
    if (t != null && t.Text == s) return i;
  }
  return -1;
}

}[/code]

CustomMultiTextNode mtn = new CustomMultiTextNode(); mtn.AddString("Tax Exempt", Color.LightCyan); // 2 mtn.AddString("GetBalance", Color.LightPink); // 3 mtn.AddString("AdjustBalance", Color.LightPink); // 4 mtn.InsertString(3, "Balance", Color.LightCyan); mtn.InsertString(4, "GetTaxExempt", Color.LightPink); mtn.InsertSeparator(4); int idx = mtn.FindString("GetTaxExempt"); // == 5 if (idx > -1) mtn.RemoveItem(idx); doc.Add(mtn);

very good!

Thanks!