Collapsing Record

I am using the CollapsingRecord class from the Demo project in one of my projects. The current behavior is that when a user clicks the GoCollapsibleHandle to expand or collapse the secion, the entire object is selected. I would like to change the behavior so that when the GoCollapsibleHandle is clicked, the object will expand or collapse WITHOUT the entire object being selected. I have been unable to determine how to prevent the entire object from being selected when the user clicks the handle. I do want to allow the object being selected when the user clicks in any other part of the node.


Try this:

public class GraphViewSelectingTool : GoToolSelecting {
public GraphViewSelectingTool(GoView v) : base(v) { }
public override void Start() {
GoCollapsibleHandle h = this.View.PickObject(true, false, this.LastInput.DocPoint, false) as GoCollapsibleHandle; // collapsible handle?
// maybe we'll find something at the input event point
if (h == null) DoSelect(this.LastInput);
// whether or not we found and/or selected anything, call DoClick
// all done!
install this tool by doing this:
ReplaceMouseTool(typeof(GoToolSelecting), new GraphViewSelectingTool(this));
Note... if a sub-item is selected, and the item is collapsed... it may make sense to move the selection to the parent. (Windows Explorer does this, for example.) This code doesn't do that.

Thanks. I wasn’t thinking of the GoTool class. Just the help I needed.