Index: proppage.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/proppage.cc,v retrieving revision 2.17 diff -u -p -r2.17 proppage.cc --- proppage.cc 21 May 2005 23:04:03 -0000 2.17 +++ proppage.cc 8 Sep 2005 03:10:17 -0000 @@ -256,6 +256,10 @@ PropertyPage::DialogProc (UINT message, { return TooltipNotificationHandler (lParam); } + case TTN_SHOW: + { + return TooltipDisplayHandler (wParam, lParam); + } default: { // Unrecognized notification Index: window.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/window.cc,v retrieving revision 2.13 diff -u -p -r2.13 window.cc --- window.cc 7 May 2005 04:27:08 -0000 2.13 +++ window.cc 8 Sep 2005 03:10:17 -0000 @@ -483,3 +483,33 @@ Window::TooltipNotificationHandler (LPAR return FALSE; } +BOOL +Window::TooltipDisplayHandler (WPARAM wParam, LPARAM lParam) +// this is the handler for TTN_SHOW notifications +{ + NMHDR *hdr = (NMHDR *)lParam; + int ctrlID = GetDlgCtrlID ((HWND)hdr->idFrom); + std::map::iterator findID = TooltipStrings.find (ctrlID); + int len, delay; + + if (ctrlID != 0 && findID != TooltipStrings.end ()) { + + // reset timeout for tooltips + SendMessage(TooltipHandle, TTM_SETDELAYTIME, TTDT_AUTOPOP, -1); + + // Fetch the string resource + TCHAR buf[2048]; + LoadString (GetInstance (), findID->second, (LPTSTR)buf, + (sizeof (buf) / sizeof (TCHAR))); + + // increase timeout proportionally for longer tooltips + if ((len = strlen(buf)) > 80) { + delay = SendMessage(TooltipHandle, TTM_GETDELAYTIME, TTDT_AUTOPOP, 0); + delay = (int) (delay * (len + 80) * 0.5 / 80); + SendMessage(TooltipHandle, TTM_SETDELAYTIME, TTDT_AUTOPOP, delay); + } + } + + return FALSE; +} + Index: window.h =================================================================== RCS file: /cvs/cygwin-apps/setup/window.h,v retrieving revision 2.11 diff -u -p -r2.11 window.h --- window.h 7 May 2005 04:27:08 -0000 2.11 +++ window.h 8 Sep 2005 03:10:17 -0000 @@ -148,6 +148,7 @@ public: void AddTooltip (int id, const char *text); void AddTooltip (int id, int string_resource); BOOL TooltipNotificationHandler (LPARAM lParam); + BOOL TooltipDisplayHandler (WPARAM wParam, LPARAM lParam); }; #endif /* SETUP_WINDOW_H */