ClassDiagramNode Part 2


I am using a slightly modified version of ClassDiagramNode.cs from demo. Currently when you select a node all other like nodes in the diagram unselect and that is a good thing (for me). What I need to be able to do is seperate the selection handling of the main body and the items in the group list. The items in the list should not be unselected when the body is unselected (for me). The items in the list should only unselect when clicked on while previously selected. (Basically work like a check box)

I don’t understand exactly what you want, but I think you do want to replace the standard GoToolSelecting tool of your view with a customized one. Your customized selecting tool can either override Start or it can override DoSelect. I haven’t tried this, but I would recommend overriding Start.

Here’s the standard definition of GoToolSelecting.Start:

[code] public override void Start() {
// maybe we’ll find something at the input event point

  // whether or not we found and/or selected anything, call DoClick

  // all done!

Instead of unconditionally calling DoSelect, you’ll want to do your own thing when this.LastInput.Control and .Shift are both false. Otherwise call DoSelect, as normal.

When .Control is false and .Shift is false, the GoTool.DoSelect method would either make the picked selectable object the only selected object, or it would clear the Selection if there is nothing selectable at the mouse point. Presumably you don’t want that deselection to take place for your check-box-like items. I think you’ll want to deselect other nodes, though.