<?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 : [solved] CXTPTabClientWnd::OnMDIDestroy bug?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : [solved] CXTPTabClientWnd::OnMDIDestroy bug?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 15 Apr 2026 08:03:58 +0000</pubDate>
  <lastBuildDate>Tue, 03 Apr 2018 09:04:43 +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=23594</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[[solved] CXTPTabClientWnd::OnMDIDestroy bug? : Hello RDHD,You are right, it is...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23594&amp;PID=76730&amp;title=solved-cxtptabclientwndonmdidestroy-bug#76730</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8730">olebed</a><br /><strong>Subject:</strong> 23594<br /><strong>Posted:</strong> 03 April 2018 at 9:04am<br /><br /><div>Hello RDHD,</div><div><br></div><div>You are right, it is bug. I have added your changes to CXTPTabClientWnd::OnMDIDestroy.</div><div><br></div><div>Note that ActivateNextTopmostItem() call there&nbsp; need for handling case when used several tab groups. Related bug could be reproduce without this line as described below:</div><div><br></div><div>- Launch GUI_VisualStudio sample</div><div>- Open 5 new documents</div><div>- Drag Untitled6 to a new horizontal tabgroup</div><div>- Open 4 more documents in that new group</div><div>- Select Untitled9</div><div>- Select Untitled4</div><div>- Click on close button of Untitled9</div><div>- Now Untitled8 (tab) is selected, but view is Untitled10 - after clicking in the bottom view tab Untitled10 gets selected ok</div><div><br></div><div>Regards,</div><div>&nbsp;Oleksandr Lebed</div>]]>
   </description>
   <pubDate>Tue, 03 Apr 2018 09:04:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23594&amp;PID=76730&amp;title=solved-cxtptabclientwndonmdidestroy-bug#76730</guid>
  </item> 
  <item>
   <title><![CDATA[[solved] CXTPTabClientWnd::OnMDIDestroy bug? : Ignore that &amp;#034;//&amp;#034; in...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23594&amp;PID=76656&amp;title=solved-cxtptabclientwndonmdidestroy-bug#76656</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 23594<br /><strong>Posted:</strong> 05 March 2018 at 4:58pm<br /><br />Ignore that "//" in front of ActivateNextTopmostItem. I was experimenting with the code since we have our own logic to determine which window to activate. Any CJ change would want to keep that line!<br>]]>
   </description>
   <pubDate>Mon, 05 Mar 2018 16:58:32 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23594&amp;PID=76656&amp;title=solved-cxtptabclientwndonmdidestroy-bug#76656</guid>
  </item> 
  <item>
   <title><![CDATA[[solved] CXTPTabClientWnd::OnMDIDestroy bug? : Is this an oversight/bug?In CX...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23594&amp;PID=76655&amp;title=solved-cxtptabclientwndonmdidestroy-bug#76655</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 23594<br /><strong>Posted:</strong> 05 March 2018 at 4:55pm<br /><br />Is this an oversight/bug?<br><br>In CXTPTabClientWnd::OnMDIDestroy, the method always calls either ActivateNextItem or ActivateNextTopmostItem. So what happens if I have, for example, three documents opened and I hit the "x" on the tab of a window that is not the active MDI window?<br><br>CodeJock deactivates the active window and activates another window depending on the tab order. This seems wrong since clicking the "x" on an inactive window does not MDI activate that window (which happens to be one of the big benefits in our system to using MDI tabs).<br><br>To see this open three documents. We are using "new tabs on the left flag". Activate the doc that goes with the right-most tab. Now hit the "x" on the middle tab. The document associated with the left-most tab activates and the active document deactivates. Since the document being closed was not active, why pick another document to activate?<br><br>I "fixed" this by getting the active window and seeing if it is the one being closed. Only if it is do I activate another document.<br><br>...<br><br>&nbsp;&nbsp;&nbsp; CWnd* pActive = MDIGetActive();<br><br>&nbsp;&nbsp;&nbsp; bool bClosingActive = false;<br><br>&nbsp;&nbsp;&nbsp; if( pActive )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if( pActive-&gt;GetSafeHwnd() == (HWND)wParam )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; bClosingActive = true;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; if( bClosingActive )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (m_afterCloseTabPosition == xtpWorkspaceActivateNextToClosed)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ActivateNextItem(FindItem((HWND)wParam));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else if (m_afterCloseTabPosition == xtpWorkspaceActivateTopmost)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp; ActivateNextTopmostItem(FindItem((HWND)wParam));<br>&nbsp;&nbsp;&nbsp; }<br><br>...<br>]]>
   </description>
   <pubDate>Mon, 05 Mar 2018 16:55:36 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23594&amp;PID=76655&amp;title=solved-cxtptabclientwndonmdidestroy-bug#76655</guid>
  </item> 
 </channel>
</rss>