]> git.saurik.com Git - wxWidgets.git/commitdiff
Interpret wxRect passed to wxRichToolTip::ShowFor() as client coords.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 2 Mar 2013 12:11:36 +0000 (12:11 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 2 Mar 2013 12:11:36 +0000 (12:11 +0000)
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

interface/wx/richtooltip.h
src/generic/richtooltipg.cpp

index 205ba266a0c854b97a188d4e5cfd47844d859187..62f6c4fdb7041fc68d0679b35b9942a685733f55 100644 (file)
@@ -182,6 +182,8 @@ public:
         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.
index 0c00e24a67f623cd86d887fcad8bc5ee48a5d260..5d08e1261a052d74459460216ba06ce9b380b787 100644 (file)
@@ -239,7 +239,7 @@ public:
         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.