FYI, I moved this topic from the JGo forum to the GoDiagram forum.
ContextClickSingleSelection just affects the behavior when there is a context click on a selected object. The default behavior is to make the context clicked object the only selected object. The modified behavior is to leave the selection alone.
In either case a context click in the background will clear the selection. In fact if the context click is on an object that is not one of the selected objects, it will clear the selection and just select that new object.
If you would like to change this behavior, I suggest you replace the standard GoToolContext tool with your own that implements the selection behavior you want. You just need to override DoSelect – maybe a no-op is what you want, but I don’t know. You’ll need to consider what the current selection is, whether the Control and/or Shift key is modifying the click, and where the click is happening.
Here is some untested code you can try:
[Serializable]
public class CustomContextTool : GoToolContext {
public CustomContextTool(GoView view) : base(view) {}
public override void DoSelect(GoInputEventArgs evt) {}
}
To replace the standard context click tool:
goView1.ReplaceMouseTool(typeof(GoToolContext), new CustomContextTool(goView1));
Walter, your untested code worked beautifully. That’s exactly the behavior I was after. Thank you! Now when I context click in the GoView background, the selection remains unchanged and I can iterate over the previously selected items.
I’m not sure what else this context click behavior will effect, but will keep playing with it. I’m subclassing a goview and using it within our app as a component. As part of that, the subclassed goview will be responsible for handling it’s own context menu. Iterating over a selection of nodes is part of that. Thanks again.