I am currently attempting to modify GoTextNode to something that resembles the image linked below:
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).
[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;
}
GoStroke s = new GoStroke();
s.Selectable = false;
s.AddPoint(0, 0);
s.AddPoint(1, 0);
AddItem(s, null, null);
return s;
}
}[/code]
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.
[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!