Print Page | Close Window

Unable to display RTF tooltips greater 80 chars

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=7231
Printed Date: 29 June 2024 at 1:08am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Unable to display RTF tooltips greater 80 chars
Posted By: mgampi
Subject: Unable to display RTF tooltips greater 80 chars
Date Posted: 24 May 2007 at 6:16pm
Hi;
I found a serious problem with CXTPToolTipContextToolTip::GetToolText() in conjunction with RTF tooltip windows - I didn't check it with the other tooltip types.
I tried to assign a longer RTF text to the tooltip window in the TTN_NEEDTEXT message handler by setting the lpszText member of the NMTTDISPINFO structure, but no tooltip window ever appeared. So after hours of debugging I broke down the problem to the CXTPToolTipContextToolTip::GetToolText() function. This function only takes the szText member of the NMTTDISPINFO structure to get the text. This is not according to the MS documentation about TTN_NEEDTEXT messages.
 
Since the GetToolText() function is not virtual, I'm unable to fix it without changing the code. Perhaps the guys at codejock will take this into account while working on the next maintenance release.


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



Replies:
Posted By: Oleg
Date Posted: 31 May 2007 at 1:29am
Hello,
 
Thanks, please patch sources now:
 
tt.szText[0] = _T('\0');
 tt.lpszText = tt.szText;
GetOwner()->SendMessage(WM_NOTIFY, id, (LPARAM)&tt);
 lpToolInfo->strCaption = tt.lpszText;
 
 
Same changes will be done for 11.2 release.
 
Thank you


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: mgampi
Date Posted: 31 May 2007 at 10:58am
Hi Oleg;
 
could you give me a hint, where to apply the patch?


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: Oleg
Date Posted: 01 June 2007 at 7:37am
In XTPToolTipContext.cpp.
 
Replace whole method:
 
CString CXTPToolTipContextToolTip::GetToolText(TOOLITEM* lpToolInfo)
{
 if (lpToolInfo->bAutoCaption)
 {
  UINT_PTR id = lpToolInfo->uId;
  TOOLTIPTEXT tt = {0};
  tt.hdr.hwndFrom = m_hWnd;
  tt.hdr.idFrom = lpToolInfo->uId;
  tt.hdr.code = TTN_NEEDTEXT;
  
  tt.uFlags = lpToolInfo->uFlags;
  tt.hinst = NULL;
  tt.szText[0] = _T('\0');
  tt.lpszText = tt.szText;
  GetOwner()->SendMessage(WM_NOTIFY, id, (LPARAM)&tt);
   
  lpToolInfo->strCaption = tt.lpszText;
  if ((m_pContext->GetControlStyle() & TTS_NOPREFIX) == 0)
  {
   CXTPDrawHelpers::StripMnemonics(lpToolInfo->strCaption);
  }
  lpToolInfo->bAutoCaption = FALSE;
 }
 return lpToolInfo->strCaption;
}


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net