Commit ff826eb1 authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

comctl32: Fix missing tooltips.

parent 03ffb734
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment