This adds "smart" popup placement which avoids getting the menus clipped by the screen, and makes that the default behavior.
The manual "popup offset" member variable is removed in favor of a virtual member function
which computes the appropriate offset on demand. (This was the consensus solution in discussion
following PR #231)
1: I moved the "set position" code in MenuItem::openPopupMenu() to after the if (notify && p) block. I did this because on code review, that does always trigger a later call to MenuItem::openPopupMenu(false), it seems cleaner to do parent notification completely before we start doing anything with the popup menu, and then set its position and open it at the same time. I don't think this is a behavior change, just reorganization.
2: I changed the way I determine the popup menu bounding box. In original PR I was using this: p->getParent() ? p->getParent()->getClipRect(false) : Rectf(Vector2f(0, 0), getRootContainerSize()) but in testing I concluded that doesn't always give good behavior. It's a bit fiddly unfortunately... I decided to just use the root container dimensions for now, since that's simple and gives good results in my programs. I put this bit of code in a virtual function to make it easier to tweak it if desired.