IGoCollapsible as a concept only supports 1 definition of “collapse” per node. (Not quite true actually: ClassDiagramNode uses collapsing within the node, but at different levels of heirarchy within the node.)
Jake,
I threw something together for you, based on MultiTextNode.
* Copyright © Northwoods Software Corporation, 1998-2008. All Rights
* Reserved.
*
* Restricted Rights: Use, duplication, or disclosure by the U.S.
* Government is subject to restrictions as set forth in subparagraph
* (c) (1) (ii) of DFARS 252.227-7013, or in FAR 52.227-19, or in FAR
* 52.227-14 Alt. III, as applicable.
*/
using System.Drawing;
using Northwoods.Go;
[Serializable]
public class MultiTextNodeDualCollapse : GoMultiTextNode {
public MultiTextNodeDualCollapse() {
this.ListGroup.LinePen = Pens.Gray;
this.ListGroup.BorderPen = Pens.Gray;
this.ListGroup.BrushColor = Color.Azure;
h.Name = "left";
h.Position = this.Position;
Add(h);
myLeftHandle = h;
h.Name = "right";
h.Handle.BrushColor = Color.Red;
h.SetSpotLocation(TopRight, this, TopRight);
Add(h);
myRightHandle = h;
protected override void CopyChildren(GoGroup newgroup, GoCopyDictionary env) {
base.CopyChildren(newgroup, env);
MultiTextNodeDualCollapse newobj = (MultiTextNodeDualCollapse)newgroup;
newobj.myLeftHandle = (CollapsibleHandleSpot)env[myLeftHandle];
newobj.myRightHandle = (CollapsibleHandleSpot)env[myRightHandle];
}
base.LayoutChildren(childchanged);
if (lhandle != null) {
lhandle.SetSpotLocation(TopLeft, this, TopLeft);
}
GoObject handle = this.myRightHandle;
if (handle != null) {
handle.SetSpotLocation(TopRight, this, TopRight);
}
}
public void Collapse(string which)
{
// fill in.
}
public void Expand(string which)
{
// fill in
}
public bool IsExpanded(string which)
{
return true; // fill in
}
private CollapsibleHandleSpot myRightHandle = null;
}
public class CollapsibleHandleSpot : GoGroup, IGoCollapsible {
public CollapsibleHandleSpot ()
{
GoCollapsibleHandle h = new GoCollapsibleHandle();
this.Add(h);
}
get { return this.FindName(Handle); }
set { this.AddChildName(value, Handle); }
}
{
get {return (GoCollapsibleHandle)this[0];}
}
MultiTextNodeDualCollapse node = this.Parent as MultiTextNodeDualCollapse;
if (node == null) return;
node.Collapse(this.Name);
}
get {
return true;
}
set {
}
}
MultiTextNodeDualCollapse node = this.Parent as MultiTextNodeDualCollapse;
if (node == null) return;
node.Expand(this.Name);
}
get {
MultiTextNodeDualCollapse node = this.Parent as MultiTextNodeDualCollapse;
if (node == null) return false;
return node.IsExpanded(this.Name);
}
}
}
Thanks Jake.
No. I’m not even sure what you mean by “recognized as GoTexts”. What are you seeing that makes you think that?
I figured out my problem. I found that the view’s AutoPostBack was set to False. This causes the nodes to be resized after the view has been resized by our program. So when I click on the collapsible handel, the view’s ObjectSingleClicked reports the selected object as GoText (I have several GoText object within this special node which inherits the GoMultiTextNode).