It makes more sense to use the window coordinates here instead of the screen
ones.
Closes #15060.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73590
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
window which must be non-@NULL or, if @a rect is non-@NULL, the middle
of the specified wxRect.
+ The coordinates of the @a rect parameter are relative to the given window.
+
Currently the native MSW implementation is used only if @a win is a
wxTextCtrl and @a rect is @NULL. This limitation may be removed in the
future.
if ( !rect || rect->IsEmpty() )
pos = GetTipPoint();
else
- pos = wxPoint( rect->x + rect->width / 2, rect->y + rect->height / 2 );
+ pos = GetParent()->ClientToScreen( wxPoint( rect->x + rect->width / 2, rect->y + rect->height / 2 ) );
// We want our anchor point to coincide with this position so offset
// the position of the top left corner passed to Move() accordingly.