Jason Edmeades : comctl32: Fix missing tooltips.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Aug 14 07:12:54 CDT 2007


Module: wine
Branch: master
Commit: ff826eb14a9e3b70e2755f7d9fdd15e117bedc5a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ff826eb14a9e3b70e2755f7d9fdd15e117bedc5a

Author: Jason Edmeades <jason.edmeades at googlemail.com>
Date:   Mon Aug 13 23:57:05 2007 +0100

comctl32: Fix missing tooltips.

---

 dlls/comctl32/tooltips.c |   39 +++++++++++++++++++++++++++++++++++----
 1 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c
index 9dd1970..3b41dda 100644
--- a/dlls/comctl32/tooltips.c
+++ b/dlls/comctl32/tooltips.c
@@ -314,7 +314,7 @@ static void TOOLTIPS_GetDispInfoA(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO
     ZeroMemory (&ttnmdi, sizeof(NMTTDISPINFOA));
     ttnmdi.hdr.hwndFrom = hwnd;
     ttnmdi.hdr.idFrom = toolPtr->uId;
-    ttnmdi.hdr.code = TTN_GETDISPINFOA;
+    ttnmdi.hdr.code = TTN_GETDISPINFOA; /* == TTN_NEEDTEXTA */
     ttnmdi.lpszText = (LPSTR)&ttnmdi.szText;
     ttnmdi.uFlags = toolPtr->uFlags;
     ttnmdi.lParam = toolPtr->lParam;
@@ -332,7 +332,6 @@ static void TOOLTIPS_GetDispInfoA(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO
         }
     }
     else if (ttnmdi.lpszText == 0) {
-        /* no text available */
         infoPtr->szTipText[0] = '\0';
     }
     else if (ttnmdi.lpszText != LPSTR_TEXTCALLBACKA) {
@@ -347,6 +346,22 @@ static void TOOLTIPS_GetDispInfoA(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO
         ERR("recursive text callback!\n");
         infoPtr->szTipText[0] = '\0';
     }
+
+    /* no text available - try calling parent instead as per native */
+    /* FIXME: Unsure if SETITEM should save the value or not        */
+    if (infoPtr->szTipText[0] == 0x00) {
+
+        SendMessageW(GetParent(toolPtr->hwnd), WM_NOTIFY,
+                    (WPARAM)toolPtr->uId, (LPARAM)&ttnmdi);
+
+        if (IS_INTRESOURCE(ttnmdi.lpszText)) {
+            LoadStringW(ttnmdi.hinst, LOWORD(ttnmdi.lpszText),
+                   infoPtr->szTipText, INFOTIPSIZE);
+        } else if (ttnmdi.lpszText &&
+                   ttnmdi.lpszText != LPSTR_TEXTCALLBACKA) {
+            Str_GetPtrAtoW(ttnmdi.lpszText, infoPtr->szTipText, INFOTIPSIZE);
+        }
+    }
 }
 
 static void TOOLTIPS_GetDispInfoW(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO *toolPtr)
@@ -357,7 +372,7 @@ static void TOOLTIPS_GetDispInfoW(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO
     ZeroMemory (&ttnmdi, sizeof(NMTTDISPINFOW));
     ttnmdi.hdr.hwndFrom = hwnd;
     ttnmdi.hdr.idFrom = toolPtr->uId;
-    ttnmdi.hdr.code = TTN_GETDISPINFOW;
+    ttnmdi.hdr.code = TTN_GETDISPINFOW; /* == TTN_NEEDTEXTW */
     ttnmdi.lpszText = (LPWSTR)&ttnmdi.szText;
     ttnmdi.uFlags = toolPtr->uFlags;
     ttnmdi.lParam = toolPtr->lParam;
@@ -375,7 +390,6 @@ static void TOOLTIPS_GetDispInfoW(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO
         }
     }
     else if (ttnmdi.lpszText == 0) {
-        /* no text available */
         infoPtr->szTipText[0] = '\0';
     }
     else if (ttnmdi.lpszText != LPSTR_TEXTCALLBACKW) {
@@ -390,6 +404,23 @@ static void TOOLTIPS_GetDispInfoW(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO
         ERR("recursive text callback!\n");
         infoPtr->szTipText[0] = '\0';
     }
+
+    /* no text available - try calling parent instead as per native */
+    /* FIXME: Unsure if SETITEM should save the value or not        */
+    if (infoPtr->szTipText[0] == 0x00) {
+
+        SendMessageW(GetParent(toolPtr->hwnd), WM_NOTIFY,
+                    (WPARAM)toolPtr->uId, (LPARAM)&ttnmdi);
+
+        if (IS_INTRESOURCE(ttnmdi.lpszText)) {
+            LoadStringW(ttnmdi.hinst, LOWORD(ttnmdi.lpszText),
+                   infoPtr->szTipText, INFOTIPSIZE);
+        } else if (ttnmdi.lpszText &&
+                   ttnmdi.lpszText != LPSTR_TEXTCALLBACKW) {
+            Str_GetPtrW(ttnmdi.lpszText, infoPtr->szTipText, INFOTIPSIZE);
+        }
+    }
+
 }
 
 static void




More information about the wine-cvs mailing list