I have a problem that I can relate back to CreateBoundingHandle.
First, I am creating a rounded rectangle handle around my objects, as suggested in an earlier post from Walter:
While Walter’s suggstion works great and does exactly what I want it to do, for any object that’s selected the object’s tooltip method won’t fire. Not only that but the object’s ports are no longer accessible either. If I unselect the object (by selecting some other object or just clicking in the GoView’s background) the handle goes away and then the object’s tooltip method works and the object’s ports are accessible.
What I don’t understand is when I just call the base method mybase.CreateBoundingHandle, I get a rectangular handle around my object that does not obscure either tooltips or ports. What can I do to my override of CreateBoundingHandle to allow tootips and ports to work as I would expect, just like the base method.
Success! What you suggested works, with a couple of modifications that suit my situation:
To the RoundedHandle class I added a member variable, mCorner, a sizef, to persist the handle corner’s width and height.
To the RoundedHandle class I added a Corner property to get/set mCorner. I modified the paint
method’s CreateRoundedRectangle to use mCorner accordingly:
DrawRoundedRectangle(g, view, this.Pen, this.Brush, r.X, r.Y,
r.Width, r.Height, mCorner.width, mCorner.height);
In the class creating the handle I, one, set the handle’s corner, and two, set the handle’s bounds, per Walter’s suggestions (link to Walter’s suggestions in my first post, above).
Well, I guess that’s it. Thanks a lot for your help, Jake. Lastly, any thoughts on why a GoHandle will work as expected but a GoRoundedRectangle with all the proper overrides will not?