<?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 : Insuring one pane remains in pane container.</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Docking Pane : Insuring one pane remains in pane container.]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 17:49:58 +0000</pubDate>
  <lastBuildDate>Fri, 26 Sep 2008 20:07:08 +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=12031</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[Insuring one pane remains in pane container. : No problem Kent.  Glad to hear...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12031&amp;PID=41427&amp;title=insuring-one-pane-remains-in-pane-container#41427</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4354">mitcheljh</a><br /><strong>Subject:</strong> 12031<br /><strong>Posted:</strong> 26 September 2008 at 8:07pm<br /><br />No problem Kent.  Glad to hear someone besides myself needs the same kind of behavior.  I've actually updated the code above to account for a couple of other things that should be considered, and to also remove the 'pin' when only one pane remains.  (Last remaining pane shouldn't be able to be unpinned or closed).&nbsp;&nbsp;&nbsp;The code is below.  In the code, you'll notice I use two different panes, a tree pane and a calendar pane.  Slight modifications will be needed for more than 2 panes.<br /><br /><table width="99%"><tr><td><pre class="BBcode"><font color=brown><font size="2"><br />enum { id_tree_pane, id_calendar_pane, id_both_panes };<br /><br />LRESULT CChildView::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)<br />{<br />  if (wParam == XTP_DPN_SHOWWINDOW) {<br />&nbsp;&nbsp;&nbsp;&nbsp;CXTPDockingPane* pPane = (CXTPDockingPane*)(lParam);<br />&nbsp;&nbsp;&nbsp;&nbsp;return onDockingPaneShowWindow(pPane);<br />  } else if (wParam == XTP_DPN_ACTION) {<br />&nbsp;&nbsp;&nbsp;&nbsp;XTP_DOCKINGPANE_ACTION* pAction = (XTP_DOCKINGPANE_ACTION*)lParam;<br />&nbsp;&nbsp;&nbsp;&nbsp;return onDockingPaneAction(pAction);<br />  }<br /><br />  return 0;<br />}<br /><br /><br />bool CChildView::onDockingPaneAction(XTP_DOCKINGPANE_ACTION* pAction)<br />{<br />  if (pAction-&gt;action == xtpPaneActionDocking)<br />  {<br />&nbsp;&nbsp;&nbsp;&nbsp;// limit docking to left and right<br />&nbsp;&nbsp;&nbsp;&nbsp;if ((pAction-&gt;dockDirection != xtpPaneDockLeft && pAction-&gt;dockDirection != xtpPaneDockRight)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; || (pAction-&gt;pDockContainer-&gt;GetType() == xtpPaneTypeTabbedContainer)) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pAction-&gt;bCancel = true;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return true;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;paneFloatingStarted = false;<br />  } else if (pAction-&gt;action == xtpPaneActionDragging) {<br />&nbsp;&nbsp;&nbsp;&nbsp;// check if other pane is already floated<br />&nbsp;&nbsp;&nbsp;&nbsp;CXTPDockingPaneInfoList& list = paneManager.GetPaneList();<br />&nbsp;&nbsp;&nbsp;&nbsp;POSITION pos = list.GetHeadPosition();<br />&nbsp;&nbsp;&nbsp;&nbsp;for (int i = 0; i &lt; list.GetCount(); ++i) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CXTPDockingPane* pPane = list.GetNext(pos);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (pPane-&gt;IsFloating()) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pAction-&gt;bCancel = true;  // other pane already floated.  Don't allow this one to float<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />  } else if (pAction-&gt;action == xtpPaneActionFloating) {<br />&nbsp;&nbsp;&nbsp;&nbsp;if (paneFloatingStarted) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pAction-&gt;bCancel = true; // more than one pane trying to float.  Don't allow<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return true;<br />&nbsp;&nbsp;&nbsp;&nbsp;} else if (!pAction-&gt;pPane-&gt;IsFloating()) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;paneFloatingStarted = true;&nbsp;&nbsp;&nbsp;// flag this pane as currently being floated<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />  } else if (pAction-&gt;action == xtpPaneActionFloated) {<br />&nbsp;&nbsp;&nbsp;&nbsp;paneFloatingStarted = false;<br />  } else if (pAction-&gt;action == xtpPaneActionDetaching) {<br />&nbsp;&nbsp;&nbsp;&nbsp;paneFloatingStarted = false;<br />  } else if (pAction-&gt;action == xtpPaneActionDocked) {<br />&nbsp;&nbsp;&nbsp;&nbsp;// add pin<br />&nbsp;&nbsp;&nbsp;&nbsp;makeHideable(id_both_panes, true);<br />&nbsp;&nbsp;&nbsp;&nbsp;paneFloatingStarted = false;<br />&nbsp;&nbsp;&nbsp;&nbsp;return XTP_ACTION_NOCLOSE;<br />  } else if (pAction-&gt;action == xtpPaneActionAttaching) {<br />&nbsp;&nbsp;&nbsp;&nbsp;// remove pin<br />&nbsp;&nbsp;&nbsp;&nbsp;makeHideable(id_both_panes, false);<br />&nbsp;&nbsp;&nbsp;&nbsp;paneFloatingStarted = false;<br />&nbsp;&nbsp;&nbsp;&nbsp;return XTP_ACTION_NOCLOSE;<br />  } else if (pAction-&gt;action == xtpPaneActionUnpinned) {<br />&nbsp;&nbsp;&nbsp;&nbsp;makeHideable(pAction-&gt;pPane-&gt;GetID() == id_tree_pane ? id_calendar_pane : id_tree_pane, false);<br />  } else if (pAction-&gt;action == xtpPaneActionPinned) {<br />&nbsp;&nbsp;&nbsp;&nbsp;makeHideable(pAction-&gt;pPane-&gt;GetID() == id_tree_pane ? id_calendar_pane : id_tree_pane, true);<br />  }<br /><br />  return false;<br />}<br /><br />void CChildView::makeHideable(UINT id, bool hideable)<br />{<br />  CXTPDockingPaneInfoList& list = paneManager.GetPaneList();<br />  POSITION pos = list.GetHeadPosition();<br />  for (int i = 0; i &lt; list.GetCount(); ++i) {<br />&nbsp;&nbsp;&nbsp;&nbsp;CXTPDockingPane* pPane = list.GetNext(pos);<br />&nbsp;&nbsp;&nbsp;&nbsp;if (id == id_both_panes || pPane-&gt;GetID() == id) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pPane-&gt;SetOptions(hideable ? xtpPaneNoCloseable : xtpPaneNoCloseable|xtpPaneNoHideable);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />  }<br />  paneManager.RedrawPanes();<br />}<br /></font></font></pre></td></tr></table>]]>
   </description>
   <pubDate>Fri, 26 Sep 2008 20:07:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12031&amp;PID=41427&amp;title=insuring-one-pane-remains-in-pane-container#41427</guid>
  </item> 
  <item>
   <title><![CDATA[Insuring one pane remains in pane container. : I for one, would like to Thank...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12031&amp;PID=41422&amp;title=insuring-one-pane-remains-in-pane-container#41422</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4346">kent_t</a><br /><strong>Subject:</strong> 12031<br /><strong>Posted:</strong> 26 September 2008 at 1:47pm<br /><br />I for one, would like to Thank You very much. <img src="http://forum.codejock.com/smileys/smiley20.gif" border="0" align="absmiddle"><br><br>That code just saved me several hours of painful trial and error code searching and testing.<br><br>I made the decision to buy CodeJock without realizing there is not any meaningful documentation, (that I can find at least). So now I have to live with it. I feel like I'm using open source software that is supported by the community instead of a company.<br><br>Thanks again, I really appreciate it.<br><br>]]>
   </description>
   <pubDate>Fri, 26 Sep 2008 13:47:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12031&amp;PID=41422&amp;title=insuring-one-pane-remains-in-pane-container#41422</guid>
  </item> 
  <item>
   <title><![CDATA[Insuring one pane remains in pane container. :  Hi,  I&amp;#039;m using a pane...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12031&amp;PID=40617&amp;title=insuring-one-pane-remains-in-pane-container#40617</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4354">mitcheljh</a><br /><strong>Subject:</strong> 12031<br /><strong>Posted:</strong> 30 August 2008 at 8:35am<br /><br /><FONT face="Times New Roman"><P align=left><FONT face="Arial, Helvetica, sans-serif" size=2>Hi, </FONT></P><P align=left><FONT face="Arial, Helvetica, sans-serif" size=2>I'm using a pane manager in my main childview, to house 2 main panes What I'd like to do now, is to insure one of the two main panes is always present in the main pane container, but it could be either one I'm guessing there's at least one way to do this in the XTP_DOCKINGPANE_ACTION event.</FONT></P><DIV><FONT face="Arial, Helvetica, sans-serif" size=2>I may need to perform a few restrictions to achieve this goal... </FONT></DIV><P align=left><FONT face="Arial, Helvetica, sans-serif" size=2>1) Preventing floating of the pane container.</FONT></P><P align=left><FONT face="Arial, Helvetica, sans-serif" size=2>2) only allowing detaching of the panes.</FONT></P><P align=left><FONT face="Arial, Helvetica, sans-serif" size=2>3) not allowing detaching of a pane if the other pane is already floated. </FONT></P><P align=left><FONT face="Arial, Helvetica, sans-serif" size=2>I think I have a handle on #3 above, but am having problems with 1 and 2.</FONT></P><P><FONT face="Arial, Helvetica, sans-serif" size=2>Thanks!</P><DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><FONT color=#330099>After a bit more work I was able to find a solution to my desired behavior.&nbsp; I thought I'd share my solution in case others needed the same kind of behavior.&nbsp; The solution includes creating a boolean class member to flag when one of the panes is just starting to be dragged.&nbsp; I'm guessing there's other solutions to achieving this behavior, so this is just one that works for me.</FONT></DIV><DIV></DIV><P><FONT color=#660000>LRESULT CChildView::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)<BR>{<BR>&nbsp; if (wParam == XTP_DPN_SHOWWINDOW) {<BR>&nbsp;&nbsp;&nbsp; CXTPDockingPane* pPane = (CXTPDockingPane*)(lParam);<BR>&nbsp;&nbsp;&nbsp; return onDockingPaneShowWindow(pPane);<BR>&nbsp; } else if (wParam == XTP_DPN_ACTION) {<BR>&nbsp;&nbsp;&nbsp; XTP_DOCKINGPANE_ACTION* pAction = (XTP_DOCKINGPANE_ACTION*)lParam;<BR>&nbsp;&nbsp;&nbsp; return onDockingPaneAction(pAction);<BR>&nbsp; }</FONT></P><P><FONT color=#660000>&nbsp; return 0;<BR>}</FONT></P><P><BR><FONT color=#660000>bool CChildView::onDockingPaneAction(XTP_DOCKINGPANE_ACTION* pAction)<BR>{<BR>&nbsp; if (pAction-&gt;action == xtpPaneActionDocking)<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp; // limit docking to left and right<BR>&nbsp;&nbsp;&nbsp; if ((pAction-&gt;dockDirection != xtpPaneDockLeft &amp;&amp; pAction-&gt;dockDirection != xtpPaneDockRight)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; || (pAction-&gt;pDockContainer-&gt;GetType() == xtpPaneTypeTabbedContainer)) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pAction-&gt;bCancel = true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; paneFloatingStarted = false;<BR>&nbsp; } else if (pAction-&gt;action == xtpPaneActionDragging) {<BR>&nbsp;&nbsp;&nbsp; // check if other pane is already floated<BR>&nbsp;&nbsp;&nbsp; CXTPDockingPaneInfoList&amp; list = paneManager.GetPaneList();<BR>&nbsp;&nbsp;&nbsp; POSITION pos = list.GetHeadPosition();<BR>&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; list.GetCount(); ++i) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CXTPDockingPane* pPane = list.GetNext(pos);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (pPane-&gt;IsFloating()) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pAction-&gt;bCancel = true;&nbsp; // other pane already floated.&nbsp; Don't allow this one to float<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; } else if (pAction-&gt;action == xtpPaneActionFloating) {<BR>&nbsp;&nbsp;&nbsp; if (paneFloatingStarted) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pAction-&gt;bCancel = true; // more than one pane trying to float.&nbsp; Don't allow<BR>&nbsp;&nbsp;&nbsp; } else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; paneFloatingStarted = true;&nbsp;&nbsp; // flag this pane as currently being f<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; return true;<BR>&nbsp; } else if (pAction-&gt;action == xtpPaneActionFloated) {<BR>&nbsp;&nbsp; paneFloatingStarted = false;<BR>&nbsp;&nbsp; return true;<BR>&nbsp; } else if (pAction-&gt;action == xtpPaneActionDetaching) {<BR>&nbsp;&nbsp;&nbsp; paneFloatingStarted = false;<BR>&nbsp;&nbsp;&nbsp; return true;<BR>&nbsp; } else if (pAction-&gt;action == xtpPaneActionDocked) {<BR>&nbsp;&nbsp;&nbsp; paneFloatingStarted = false;<BR>&nbsp;&nbsp;&nbsp; return true;<BR>&nbsp; }</FONT></P><P><FONT color=#660000>&nbsp; return false;<BR>}<BR></FONT></P><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV></FONT></FONT>]]>
   </description>
   <pubDate>Sat, 30 Aug 2008 08:35:35 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12031&amp;PID=40617&amp;title=insuring-one-pane-remains-in-pane-container#40617</guid>
  </item> 
 </channel>
</rss>