<?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 : How to reorder CXTPTabClientWnd tabs by code?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : How to reorder CXTPTabClientWnd tabs by code?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 11 Jun 2026 14:52:08 +0000</pubDate>
  <lastBuildDate>Mon, 19 May 2008 11:16:52 +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=10625</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[How to reorder CXTPTabClientWnd tabs by code? : Hi; for anyone who&amp;#039;s interrested...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10625&amp;PID=35417&amp;title=how-to-reorder-cxtptabclientwnd-tabs-by-code#35417</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 10625<br /><strong>Posted:</strong> 19 May 2008 at 11:16am<br /><br />Hi;<DIV>for anyone who's interrested in this; the solution is to derive from CXTPTabClientWnd and add a sort function that removes all items and afterwards add them again in sorted order:</DIV><DIV>&nbsp;</DIV><DIV>void CXRSortableTabClientWnd::Sort() {<BR>&nbsp;// Get the set of all opened MDI client windows<BR>&nbsp;std::set&lt;CMDIChildWnd*&gt; clients;<BR>&nbsp;xrApp-&gt;GetMDIClientMap(clients);<BR>&nbsp;// Insert the set into a multimap sorted by document title<BR>&nbsp;std::multimap&lt;_tstring, CMDIChildWnd*&gt; sorted;<BR>&nbsp;for (std::set&lt;CMDIChildWnd*&gt;::const_iterator i=clients.begin(); i!=clients.end(); ++i) {<BR>&nbsp;&nbsp;CString strItem=GetItemText(*i);<BR>&nbsp;&nbsp;sorted.insert(std::make_pair(_tstring(strItem), *i));<BR>&nbsp;}</DIV><DIV>&nbsp;m_bLockReposition = TRUE;</DIV><DIV>&nbsp;// Remove all current tab items<BR>&nbsp;m_pActiveWorkspace-&gt;DeleteAllItems();</DIV><DIV>&nbsp;XTPWorkspaceNewTabPosition position=GetNewTabPositon();<BR>&nbsp;SetNewTabPosition(xtpWorkspaceNewTabRightMost);</DIV><DIV>&nbsp;// Add tab items in a sorted manner<BR>&nbsp;for (std::multimap&lt;_tstring, CMDIChildWnd*&gt;::const_iterator i=sorted.begin();i!=sorted.end(); ++i) {<BR>&nbsp;&nbsp;CXTPTabManagerItem* pFoundItem = AddItem(i-&gt;second);<BR>&nbsp;&nbsp;pFoundItem-&gt;SetHandle(i-&gt;second-&gt;GetSafeHwnd());<BR>&nbsp;}</DIV><DIV>&nbsp;m_bLockReposition = FALSE;</DIV><DIV>&nbsp;SetNewTabPosition(position);<BR>&nbsp;Reposition();<BR>}</DIV>]]>
   </description>
   <pubDate>Mon, 19 May 2008 11:16:52 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10625&amp;PID=35417&amp;title=how-to-reorder-cxtptabclientwnd-tabs-by-code#35417</guid>
  </item> 
  <item>
   <title><![CDATA[How to reorder CXTPTabClientWnd tabs by code? : Hi, does anybody know how to...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10625&amp;PID=35202&amp;title=how-to-reorder-cxtptabclientwnd-tabs-by-code#35202</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 10625<br /><strong>Posted:</strong> 14 May 2008 at 4:29pm<br /><br />Hi,<DIV>does anybody know how to reorder <FONT size=2>CXTPTabClientWnd tabs by code?</FONT></DIV><DIV><FONT size=2>In detail: I want to sort the opened documents by name.</FONT></DIV>]]>
   </description>
   <pubDate>Wed, 14 May 2008 16:29:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10625&amp;PID=35202&amp;title=how-to-reorder-cxtptabclientwnd-tabs-by-code#35202</guid>
  </item> 
 </channel>
</rss>