Select an object from GoPalette

Hi!
I have the problem:
I have the GoPalette. If I click on some of objects of GoPalette, fairly often It doesn’t select. The GoPalette contains GoIconicNode objects. Only if I click exactly on some of lines of an object, then it stands as selected. It’s difficult and not convenient to select objects only if you will click exactly by line of some object. Is there any way to select an object if you have clicked near it? I have tried to resolve this problem the following way:

  1. I declared the class MyGoPalette, which is derrived from GoPalette
  2. Overrided the method OnClick:

protected override void OnClick(EventArgs e)
{
var p = this.PointToClient(Cursor.Position);
var ob = this.PickObjectsInRectangle(true, false, new RectangleF(p, new SizeF(10, 10)), GoPickInRectangleStyle.SelectableOnlyIntersectsBounds, null, 1).FirstOrDefault();
if (ob != null)
{
this.Selection.Add(ob);
}
base.OnClick(e);
}


It seems the method PointToClient doesn’t return correct coords…
What do i do wrong?
Thanks!

The simplest thing to do is this:

node.PickableBackground = true;

Thanks a lot, Jake! :) It works!!! :))

Ок, It really works, but PickableBackground property defined in GoGroup class.
Is there any way to achive that If an object derived from GoDrawing?
Thanks!

Add the GoDrawing to a GoGroup would be the simplest thing to do. Look at how DrawDemo adds
the GoDrawing object to an GoIconicNode (to get a label) and then just “drops” the GoDrawing part.

(Although DrawDemo doesn’t set PickableBackground and it should.)

or… you could override GoObject Pick. See the API reference for details on Pick.