<?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 : Small HitTest Issue with CXTPTabWorkspace</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Small HitTest Issue with CXTPTabWorkspace]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 19 Apr 2026 16:04:26 +0000</pubDate>
  <lastBuildDate>Thu, 05 Feb 2004 18:37:24 +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=423</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[Small HitTest Issue with CXTPTabWorkspace : I missed adding the same exclusion...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=423&amp;PID=966&amp;title=small-hittest-issue-with-cxtptabworkspace#966</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=350">vladsch</a><br /><strong>Subject:</strong> 423<br /><strong>Posted:</strong> 05 February 2004 at 6:37pm<br /><br /><P>I missed adding the same exclusion test in CXTPTabWorkspace::LButtonDown around the for loop, this disables dragging of a tab by starting in the button area:</P><P><table width="99%"><tr><td><pre class="BBcode"></P><P>&nbsp;&nbsp;&nbsp; CRect rc;<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; GetClientRect(&amp;rc);<BR>&nbsp;&nbsp;&nbsp; rc.right -= m_nButtonWidth;<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; if (rc.PtInRect(point))<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; m_arrTab.GetSize(); i++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; if (m_arrTab<em>.rcItem.PtInRect(point))<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; {<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int j = 0; j &lt; m_arrTab.GetSize(); j++)<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_lstRects.Add(m_arrTab&#091;j&#093;.rcItem);<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_nItemTracking = i;<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetCapture();<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Invalidate(FALSE);<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }</P><P>&nbsp;&nbsp;&nbsp; CWnd::OnLButtonDown(nFlags, point);<BR>}<BR></pre></td></tr></table></P>]]>
   </description>
   <pubDate>Thu, 05 Feb 2004 18:37:24 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=423&amp;PID=966&amp;title=small-hittest-issue-with-cxtptabworkspace#966</guid>
  </item> 
  <item>
   <title><![CDATA[Small HitTest Issue with CXTPTabWorkspace : The CXTPTabWorkspace control does...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=423&amp;PID=965&amp;title=small-hittest-issue-with-cxtptabworkspace#965</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=350">vladsch</a><br /><strong>Subject:</strong> 423<br /><strong>Posted:</strong> 05 February 2004 at 5:27pm<br /><br /><P>The CXTPTabWorkspace control does not exclude the button region from the tab hit test. This makes a partial tab displayed under the button area&nbsp;show as Hovering over when the mouse is in the button area. Also allows you to Drag a tab when starting the drag in the button area.</P><P>Solution:</P><P>Add protected int m_nButtonWidth member to CXTPTabWorkspace. In paint manager DrawTabControlXXXXX functions at the top of each function clear this variable to 0 and after caclulating the nButtonWidth local variable assign the value to pCtrlTab-&gt;m_nButtonWidth. In every style of paint manager DrawTabControlXXXX.</P><P>Change HitTest to exclude that area from a valid tab button area.</P><P><table width="99%"><tr><td><pre class="BBcode"></P><P>int CXTPTabWorkspace::HitTest(CPoint point)<BR>{<BR>&nbsp;&nbsp;&nbsp; CRect rc;</P><P>&nbsp;&nbsp;&nbsp; GetClientRect(&amp;rc);<BR>&nbsp;&nbsp;&nbsp; rc.right -= m_nButtonWidth;</P><P>&nbsp;&nbsp;&nbsp; if (rc.PtInRect(point))<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; m_arrTab.GetSize(); i++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; if (m_arrTab<EM>.rcItem.PtInRect(point))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return i;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; return -1;<BR>}</P><P></pre></td></tr></table></P><P>Add the same wrapper in CXTPTabWorkspace::OnMouseMove</P><P><table width="99%"><tr><td><pre class="BBcode"></P><P>void CXTPTabWorkspace::OnMouseMove(UINT nFlags, CPoint point)<BR>{<BR>&nbsp;&nbsp;&nbsp; CRect rc;</P><P>&nbsp;&nbsp;&nbsp; GetClientRect(&amp;rc);<BR>&nbsp;&nbsp;&nbsp; rc.right -= m_nButtonWidth;</P><P>&nbsp;&nbsp;&nbsp; if (rc.PtInRect(point))<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (m_nItemTracking != -1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; . . .</P><P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;}</P><P>&nbsp;&nbsp;&nbsp; else</P><P>&nbsp;&nbsp;&nbsp; {</P><P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (TRUE)//if (m_dwStyle &amp; CBRS_ALIGN_TOP)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; m_btnClose.CheckForMouseOver(this, point);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; m_btnLeft.CheckForMouseOver(this, point);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; m_btnRight.CheckForMouseOver(this, point);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }</P><P>&nbsp;&nbsp;&nbsp; HighlightFocused();</P><P>&nbsp;&nbsp;&nbsp; CWnd::OnMouseMove(nFlags, point);<BR>}<BR></pre></td></tr></table></P><P>The tabs will stop seeing the mouse in the button area as over the tab. Someone who is more familiar with the toolkit should review this fix. I could have easily missed something critical.</P><P>&nbsp;</P></EM><span style="font-size:10px"><br /><br />Edited by vladsch</span>]]>
   </description>
   <pubDate>Thu, 05 Feb 2004 17:27:02 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=423&amp;PID=965&amp;title=small-hittest-issue-with-cxtptabworkspace#965</guid>
  </item> 
 </channel>
</rss>