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.
[Serializable] 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 DoClick(this.LastInput);
// all done! StopTool(); } }
[/code]
install this tool by doing this:
[code]
ReplaceMouseTool(typeof(GoToolSelecting), new GraphViewSelectingTool(this));
[/code]
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.