From 186af620770e03b01e071da328d3aaabca839d20 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Oct 2002 19:42:57 +0000 Subject: [PATCH] support for tooltips longer than 80 characters git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/tooltip.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index 930748cdbf..a8a9e5b3f7 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -274,12 +274,14 @@ void wxToolTip::Add(WXHWND hWnd) wxToolInfo ti(hwnd); - // as we store our text anyhow, it seems useless to waste system memory - // by asking the tooltip ctrl to remember it too - instead it will send - // us TTN_NEEDTEXT (via WM_NOTIFY) when it is about to be shown + // another possibility would be to specify LPSTR_TEXTCALLBACK here as we + // store the tooltip text ourselves anyhow, and provide it in response to + // TTN_NEEDTEXT (sent via WM_NOTIFY), but then we would be limited to 79 + // character tooltips as this is the size of the szText buffer in + // NMTTDISPINFO struct -- and setting the tooltip here we can have tooltips + // of any length ti.hwnd = hwnd; - ti.lpszText = LPSTR_TEXTCALLBACK; - // instead of: ti.lpszText = (char *)m_text.c_str(); + ti.lpszText = (wxChar *)m_text.c_str(); // const_cast if ( !SendTooltipMessage(GetToolTipCtrl(), TTM_ADDTOOL, 0, &ti) ) {