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
This commit is contained in:
Vadim Zeitlin
2002-10-28 19:42:57 +00:00
parent 8f3c90b718
commit 186af62077

View File

@@ -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) )
{