<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Bug in office 2013 tooltips + solution</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Controls : Bug in office 2013 tooltips + solution]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 03:34:28 +0000</pubDate>
  <lastBuildDate>Thu, 26 Jun 2014 22:00:04 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=22213</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Bug in office 2013 tooltips + solution : Hello Michl,Thank you for the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22213&amp;PID=72579&amp;title=bug-in-office-2013-tooltips-solution#72579</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8199">astoyan</a><br /><strong>Subject:</strong> 22213<br /><strong>Posted:</strong> 26 June 2014 at 10:00pm<br /><br />Hello Michl,<div><br></div><div>Thank you for the proposed solution. We have applied your changes. The fix will be available in the next beta release.</div><div><br></div><div><div>Thank you.</div><div>Regards,</div><div>&nbsp; Alexander Stoyan</div></div>]]>
   </description>
   <pubDate>Thu, 26 Jun 2014 22:00:04 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22213&amp;PID=72579&amp;title=bug-in-office-2013-tooltips-solution#72579</guid>
  </item> 
  <item>
   <title><![CDATA[Bug in office 2013 tooltips + solution : HelloTitles are truncated if description...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22213&amp;PID=72276&amp;title=bug-in-office-2013-tooltips-solution#72276</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3301">Michl</a><br /><strong>Subject:</strong> 22213<br /><strong>Posted:</strong> 20 February 2014 at 6:09am<br /><br />Hello<br><br>Titles are truncated if description is very short.<br>Your can reproduce it easy in calendar sample! Just switch to office 2013 style and change the description of a ribbon button to a short text.<br><br><img src="uploads/3301/Office_2013_tooltip_bug.png" height="433" width="445" border="0" /><br><br><b>Please move Tooltip-Classes from .cpp to .h! So it's not possible to derive class to fix it myself.</b><br><br>-------------------------------------------------------------------------------------------------------------------------<br><br>Because codejock don't unlock my solution for other users <img src="http://forum.codejock.com/smileys/smiley7.gif" border="0" alt="Angry" title="Angry" />, I will attach my solution to this thread.<span id="result_" lang="en"><span><br><br>.h<br><table width="99%"><tr><td><pre class="BBcode"><br>class CXTPBugfixedToolTipContext : public CXTPToolTipContext<br>{<br>&nbsp;&nbsp;&nbsp; class CBugfixedOffice2013ToolTip;<br>&nbsp;&nbsp;&nbsp; friend CBugfixedOffice2013ToolTip;<br><br>&nbsp;&nbsp;&nbsp; public:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; virtual CWnd* CreateToolTip(CWnd* pOwner);<br>};<br></pre></td></tr></table><br><br></span></span><br><span id="result_" lang="en"><span>.cpp<br><table width="99%"><tr><td><pre class="BBcode"><br>class CXTPBugfixedToolTipContext::CBugfixedOffice2013ToolTip : public CXTPToolTipContextToolTip<br>{<br>public:<br>&nbsp;&nbsp;&nbsp; CBugfixedOffice2013ToolTip(CXTPToolTipContext* pContext)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; : CXTPToolTipContextToolTip(pContext)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; }<br><br>protected:<br>&nbsp;&nbsp;&nbsp; virtual CSize GetToolSize(TOOLITEM* lpToolInfo);<br>&nbsp;&nbsp;&nbsp; virtual void DrawBackground(CDC* pDC, TOOLITEM* lpToolInfo, CRect rc);<br>&nbsp;&nbsp;&nbsp; virtual void DrawEntry(CDC* pDC, TOOLITEM* lpToolInfo, CRect rc);<br>};<br><br>CSize CXTPBugfixedToolTipContext::CBugfixedOffice2013ToolTip::GetToolSize(TOOLITEM* lpToolInfo)<br>{<br>&nbsp;&nbsp;&nbsp; CClientDC dc(this);<br><br>&nbsp;&nbsp;&nbsp; CXTPBugfixedToolTipContext* pFriendContext = static_cast&lt;CXTPBugfixedToolTipContext*&gt;(m_pContext);<br><br>&nbsp;&nbsp;&nbsp; CFont* pOldFont = dc.SelectObject(&amp;pFriendContext-&gt;m_fnt);<br><br>&nbsp;&nbsp;&nbsp; CString str = GetToolText(lpToolInfo);<br><br>&nbsp;&nbsp;&nbsp; if (str.IsEmpty())<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dc.SelectObject(pOldFont);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return CSize(0);<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; int nMaxTipWidth = GetMaxTipWidth();<br>&nbsp;&nbsp;&nbsp; BOOL bDrawTitle = !m_strTitle.IsEmpty();<br><br>&nbsp;&nbsp;&nbsp; CRect rcMargin = m_pContext-&gt;GetMargin();<br>&nbsp;&nbsp;&nbsp; CSize szMargin;<br>&nbsp;&nbsp;&nbsp; if (bDrawTitle)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; szMargin.cx = 12 + rcMargin.left + rcMargin.right + 12;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; szMargin.cy = 7 + rcMargin.top + rcMargin.bottom + 7;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; szMargin.cx = 5 + rcMargin.left + rcMargin.right + 5;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; szMargin.cy = 5 + rcMargin.top + rcMargin.bottom + 5;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; DWORD dwFlags = DT_NOPREFIX | DT_EXPANDTABS;<br><br>&nbsp;&nbsp;&nbsp; CSize szTitle(0, 0);<br><br>&nbsp;&nbsp;&nbsp; if (bDrawTitle)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPFontDC fntTitle(&amp;dc, &amp;pFriendContext-&gt;m_fntTitle);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CRect rcTitle(0, 0, 0, 0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dc.DrawText(m_strTitle, rcTitle, dwFlags | DT_CALCRECT | DT_SINGLELINE);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; szTitle = CSize(rcTitle.Width(), rcTitle.Height() + 6);<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; CRect rcText(0, 0, nMaxTipWidth - szMargin.cx, 0);<br><br>&nbsp;&nbsp;&nbsp; if (bDrawTitle &amp;&amp; szTitle.cx &gt; nMaxTipWidth)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; szTitle.cx = nMaxTipWidth;<br><br>&nbsp;&nbsp;&nbsp; dc.DrawText(str, rcText, dwFlags | DT_CALCRECT | DT_WORDBREAK);<br>&nbsp;&nbsp;&nbsp; dc.SelectObject(pOldFont);<br><br>&nbsp;&nbsp;&nbsp; CSize szText = rcText.Size();<br><br>&nbsp;&nbsp;&nbsp; CSize sz = szText;<br>&nbsp;&nbsp;&nbsp; if (bDrawTitle)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sz.cx = max(sz.cx, szTitle.cx);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sz.cy += szTitle.cy;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; sz.cx += szMargin.cx;<br>&nbsp;&nbsp;&nbsp; sz.cy += szMargin.cy;<br>&nbsp;&nbsp;&nbsp; return sz;<br>}<br><br>void CXTPBugfixedToolTipContext::CBugfixedOffice2013ToolTip::DrawBackground(CDC* pDC, TOOLITEM* /*lpToolInfo*/, CRect rc)<br>{<br>&nbsp;&nbsp;&nbsp; pDC-&gt;FillSolidRect(&amp;rc, RGB(0xff, 0xff, 0xff));<br><br>&nbsp;&nbsp;&nbsp; const COLORREF clrBorder = RGB(190, 190, 190);<br>&nbsp;&nbsp;&nbsp; pDC-&gt;Draw3dRect(rc, clrBorder, clrBorder);<br>}<br><br>void CXTPBugfixedToolTipContext::CBugfixedOffice2013ToolTip::DrawEntry(CDC* pDC, TOOLITEM* lpToolInfo, CRect rc)<br>{<br>&nbsp;&nbsp;&nbsp; CXTPBugfixedToolTipContext* pFriendContext = static_cast&lt;CXTPBugfixedToolTipContext*&gt;(m_pContext);<br><br>&nbsp;&nbsp;&nbsp; CString str = lpToolInfo-&gt;strCaption;<br><br>&nbsp;&nbsp;&nbsp; rc.DeflateRect(m_pContext-&gt;GetMargin());<br><br>&nbsp;&nbsp;&nbsp; DWORD dwFlags = DT_NOPREFIX | DT_EXPANDTABS;<br>&nbsp;&nbsp;&nbsp; BOOL bLayoutRTL = lpToolInfo-&gt;hwnd &amp;&amp; GetWindowLong(lpToolInfo-&gt;hwnd, GWL_EXSTYLE) &amp; WS_EX_LAYOUTRTL;<br><br>&nbsp;&nbsp;&nbsp; if (bLayoutRTL)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dwFlags |= DT_RTLREADING | DT_RIGHT;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; int clrTextOld = pDC-&gt;SetTextColor(RGB(93, 93, 93));<br><br>&nbsp;&nbsp;&nbsp; BOOL bDrawTitle = !m_strTitle.IsEmpty();<br>&nbsp;&nbsp;&nbsp; if (bDrawTitle)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rc.DeflateRect(12, 7, 12, 7);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPFontDC fnt(pDC, &amp;pFriendContext-&gt;m_fntTitle);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CRect rcTitle(rc.left, rc.top, rc.right, rc.bottom);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pDC-&gt;DrawText(m_strTitle, rcTitle, dwFlags | DT_SINGLELINE);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rc.top += pDC-&gt;GetTextExtent(m_strTitle).cy + 6;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rc.DeflateRect(5, 5, 5, 5);<br><br>&nbsp;&nbsp;&nbsp; pDC-&gt;DrawText(str, rc, dwFlags | DT_WORDBREAK);<br>&nbsp;&nbsp;&nbsp; pDC-&gt;SetTextColor(clrTextOld);<br>}<br><br>CWnd* CXTPBugfixedToolTipContext::CreateToolTip(CWnd* pOwner)<br>{<br>&nbsp;&nbsp;&nbsp; if (m_toolStyle == xtpToolTipOffice2013)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return new EXTPBugfixedToolTipContext::CBugfixedOffice2013ToolTip(this);<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return __super::CreateToolTip(pOwner);<br>}<br></pre></td></tr></table><br><br>Enjoy! <img src="http://forum.codejock.com/smileys/smiley2.gif" border="0" alt="Wink" title="Wink" /></span></span><br>]]>
   </description>
   <pubDate>Thu, 20 Feb 2014 06:09:03 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22213&amp;PID=72276&amp;title=bug-in-office-2013-tooltips-solution#72276</guid>
  </item> 
 </channel>
</rss>