Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Unable to display RTF tooltips greater 80 chars
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Unable to display RTF tooltips greater 80 chars

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: Unable to display RTF tooltips greater 80 chars
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.