<?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 : ResizeFormView in child frame with splitters</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : ResizeFormView in child frame with splitters]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 04 Apr 2026 04:12:36 +0000</pubDate>
  <lastBuildDate>Mon, 22 Oct 2007 04:48:25 +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=8469</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[ResizeFormView in child frame with splitters : Hi,   I traced the execution...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8469&amp;PID=27520&amp;title=resizeformview-in-child-frame-with-splitters#27520</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3359">dmcminn_mwd</a><br /><strong>Subject:</strong> 8469<br /><strong>Posted:</strong> 22 October 2007 at 4:48am<br /><br />Hi, <DIV>&nbsp;</DIV><DIV>I traced the execution of my code and what the toolkit library does. The flow of function calls through my code is this:</DIV><DIV><table width="99%"><tr><td><pre class="BBcode">CChildFrame::OnCreateClient: Creating control view<BR>1 CCJ_XTResizeFormView::OnCreate: Enter<BR>2 CCJ_XTResizeFormView::OnCreate: Designed width=222 height=650<BR>3 CCJ_XTResizeFormView::OnSize: new width=222 height=650<BR>4 CCJ_XTResizeFormView::OnInitDialog: Enter, window rect width=222 height=650<BR>5 CCJ_XTResizeFormView::OnInitDialog: Enter, client rect width=222 height=650<BR>6 CCJ_XTResizeFormView::OnInitDialog: Enter, init width=0 height=0<BR>7 CCJ_XTResizeFormView::OnInitDialog: Enter, init width=0 height=0<BR>8 CCJ_XTResizeFormView::OnInitDialog: After window rect width=222 height=650<BR>9 CCJ_XTResizeFormView::OnInitDialog: After, client rect width=222 height=650<BR>10 CCJ_XTResizeFormView::OnInitDialog: After, init width=222 height=650<BR>11 CCJ_XTResizeFormView::OnInitDialog: After, min width=222 height=650<BR>12 CCJ_XTResizeFormView::OnSize: new width=223 height=650</DIV><DIV>13 CChildFrame::OnCreateClient: Creating dummy view<BR>14 CCJ_XTResizeFormView::OnSize: new width=223 height=430</pre></td></tr></table></DIV><DIV>&nbsp;</DIV><DIV>On lines 3-4 this first OnSize shows the designed size of the form which is correct, and the controls will be created at their correct positions. I set up my resize items after line 11. Line 12 is the size message sent by the splitter using the sizes I specify at the start of this sequence (before line 1). Line 14 is the CScrollView base class trying to set various sizes.</DIV><DIV>&nbsp;</DIV><DIV>If I set the size of the splitter pane to CSize(0,0) then the XTResize::Size() returns before doing anything. Similarly if I set the pane size to be the exact size required for the form view then XTResize::Size() returns before doing anything because it thinks the window size has not changed.</DIV><DIV>&nbsp;</DIV><DIV>If I set the size to something different from the exact size (e.g. 1 pixel wider) then XTResize::Size() performs it's processing but then it sets the resize item's sizes to something incorrect (the degree of incorrect is determined by how different the sizes I specify are from the&nbsp;designed sizes)&nbsp;and sets their m_bInitialSize flag. The controls are then all resized from an incorrect base size.</DIV><DIV>&nbsp;</DIV><DIV>Is there some way to force a call to Size() using the current window sizes as the initial size?</DIV><DIV>&nbsp;</DIV><DIV>Edit: a bit of a hack, but I've just went through the m_arrItems setting their m_bInitialSize to true after I've set their resizes (since that finds their correct sizes without having to get a WM_SIZE message).</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Mon, 22 Oct 2007 04:48:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8469&amp;PID=27520&amp;title=resizeformview-in-child-frame-with-splitters#27520</guid>
  </item> 
  <item>
   <title><![CDATA[ResizeFormView in child frame with splitters : Hi Oleg,  Thanks for the response....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8469&amp;PID=27460&amp;title=resizeformview-in-child-frame-with-splitters#27460</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3359">dmcminn_mwd</a><br /><strong>Subject:</strong> 8469<br /><strong>Posted:</strong> 19 October 2007 at 9:52am<br /><br />Hi Oleg,<DIV>&nbsp;</DIV><DIV>Thanks for the response. After you mentioned that I had made the pane too small I traced the execution, checking the form view's width at each stage. The width was 222 pixels, but the pane had to be set to 223 for it to show the correct size. I tried a variety of initial sizes and here was what I found:</DIV><DIV>&nbsp;</DIV><DIV>&lt;=220 - ok, shows scrollbar at bottom</DIV><DIV>221 - not ok, scrollbar at bottom, no scrollbar at right but space&nbsp;for it</DIV><DIV>222 - not ok, no scrollbars but space on right for scrollbar</DIV><DIV>&gt;=223 - ok</DIV><DIV>&nbsp;</DIV><DIV>I've seen a lot of Windows applications have trouble to decide when to show scrollbars when on the minimum limits. I guess this is a problem with the underlying CScrollView or the window's native classes.</DIV><DIV>&nbsp;</DIV><DIV>But thank you for pointing me on the correct track.</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 19 Oct 2007 09:52:41 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8469&amp;PID=27460&amp;title=resizeformview-in-child-frame-with-splitters#27460</guid>
  </item> 
  <item>
   <title><![CDATA[ResizeFormView in child frame with splitters : Hi,   When it comes first it...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8469&amp;PID=27454&amp;title=resizeformview-in-child-frame-with-splitters#27454</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 8469<br /><strong>Posted:</strong> 19 October 2007 at 7:33am<br /><br />Hi, <DIV>&nbsp;</DIV><DIV>When it comes first it shows scrollbars and CXTResize get wrong width.</DIV><DIV>&nbsp;</DIV><DIV>Just increase size a little:</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV><FONT color=#0000ff size=1><P>if</FONT><FONT size=1>(</FONT><FONT color=#020002 size=1>m_LRSplitter</FONT><FONT size=1>.</FONT><FONT color=#020002 size=1>CreateStatic</FONT><FONT size=1>(</FONT><FONT color=#0000ff size=1>this</FONT><FONT size=1>, 1, 2, </FONT><FONT color=#020002 size=1>WS_CHILD</FONT><FONT size=1> | </FONT><FONT color=#020002 size=1>WS_VISIBLE</FONT><FONT size=1> | </FONT><FONT color=#020002 size=1>WS_BORDER</FONT><FONT size=1>))</P><P>{</P><P></FONT><FONT color=#020002 size=1>m_LRSplitter</FONT><FONT size=1>.</FONT><FONT color=#020002 size=1>SetFullDrag</FONT><FONT size=1>(</FONT><FONT color=#020002 size=1>FALSE</FONT><FONT size=1>);</P><P></FONT><FONT color=#020002 size=1>m_LRSplitter</FONT><FONT size=1>.</FONT><FONT color=#020002 size=1>SetSplitterStyle</FONT><FONT size=1>(</FONT><FONT color=#020002 size=1>XT_SPLIT_DOTTRACKER</FONT><FONT size=1>|</FONT><FONT color=#020002 size=1>XT_SPLIT_NOFULLDRAG</FONT><FONT size=1>);</P><P></P><P></FONT><FONT color=#0000ff size=1>if</FONT><FONT size=1>(</FONT><FONT color=#020002 size=1>m_LRSplitter</FONT><FONT size=1>.</FONT><FONT color=#020002 size=1>CreateView</FONT><FONT size=1>(0, 0, </FONT><FONT color=#020002 size=1>RUNTIME_CLASS</FONT><FONT size=1>(</FONT><FONT color=#020002 size=1>CCJ_XTResizeFormView</FONT><FONT size=1>), </FONT><FONT color=#020002 size=1>CSize</FONT><FONT size=1>(<strong>230</strong>, 0), </FONT><FONT color=#020002 size=1>pContext</FONT><FONT size=1>))</P><P>{</P><P></FONT><FONT color=#020002 size=1>create_ok</FONT><FONT size=1> = </FONT><FONT color=#020002 size=1>m_LRSplitter</FONT><FONT size=1>.</FONT><FONT color=#020002 size=1>CreateView</FONT><FONT size=1>(0, 1, </FONT><FONT color=#020002 size=1>RUNTIME_CLASS</FONT><FONT size=1>(</FONT><FONT color=#020002 size=1>CDummyView</FONT><FONT size=1>), </FONT><FONT color=#020002 size=1>CSize</FONT><FONT size=1>(0, 0), </FONT><FONT color=#020002 size=1>pContext</FONT><FONT size=1>);</P><P>}</P><P>} </FONT><FONT color=#008000 size=1>// L/R control/display splitter created OK</P></FONT><FONT size=1><P></P><P></FONT><FONT color=#0000ff size=1>if</FONT><FONT size=1>(</FONT><FONT color=#020002 size=1>create_ok</FONT><FONT size=1>)</P><P>{</P><P></FONT><FONT color=#020002 size=1>CCJ_XTResizeFormView</FONT><FONT size=1> *</FONT><FONT color=#020002 size=1>control_view</FONT><FONT size=1> = </FONT><FONT color=#0000ff size=1>static_cast</FONT><FONT size=1>&lt;</FONT><FONT color=#020002 size=1>CCJ_XTResizeFormView</FONT><FONT size=1> *&gt;(</FONT><FONT color=#020002 size=1>m_LRSplitter</FONT><FONT size=1>.</FONT><FONT color=#020002 size=1>GetPane</FONT><FONT size=1>(0, 0));</P><P></FONT><FONT color=#008000 size=1><strong>//m_LRSplitter.SetColumnInfo(0, control_view-&gt;GetDesignedRect().Width(), control_view-&gt;GetDesignedRect().Width());</strong></P></FONT><FONT size=1><P></FONT><FONT color=#020002 size=1>m_LRSplitter</FONT><FONT size=1>.</FONT><FONT color=#020002 size=1>SetColumnInfo</FONT><FONT size=1>(1, 0, 0);</P><P>}</P></FONT></DIV>]]>
   </description>
   <pubDate>Fri, 19 Oct 2007 07:33:34 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8469&amp;PID=27454&amp;title=resizeformview-in-child-frame-with-splitters#27454</guid>
  </item> 
  <item>
   <title><![CDATA[ResizeFormView in child frame with splitters :  Hello,  I&amp;#039;m trying to...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8469&amp;PID=27450&amp;title=resizeformview-in-child-frame-with-splitters#27450</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3359">dmcminn_mwd</a><br /><strong>Subject:</strong> 8469<br /><strong>Posted:</strong> 19 October 2007 at 5:39am<br /><br /><DIV></DIV><DIV>Hello,</DIV><DIV>&nbsp;</DIV><DIV>I'm trying to get a resize form view working in my current application (MFC MDI with splitter in child frame showing two views). I have previously got resizable dialogs to work and have done the resizable forms in a similar way and I can get my form view resized.</DIV><DIV>&nbsp;</DIV><DIV>However, the controls are all initally resized so that they are not as wide as&nbsp;I would expect - before I added the resizing code they would fill the left pane of the splitter exactly as designed.</DIV><DIV>&nbsp;</DIV><DIV>It looks as if they are not as wide by the width of a scrollbar. It could be possible since my form view design is quite tall, although when maximised (set on create) it will fit vertically without requiring a scrollbar. I'm probably doing something stupid when I create the splitter and views in my child frame but I can't figure out what.</DIV><DIV>&nbsp;</DIV><DIV>Does anyone have any experience they could offer?</DIV><DIV>&nbsp;</DIV><DIV>An example solution (MSVC2005) which shows the problem is here: <a href="http://www.david-mcminn.co.uk/files/resize&#102;orm.zip" target="_blank">http://www.david-mcminn.co.uk/files/resizeform.zip</A></DIV><DIV>&nbsp;</DIV><DIV>Thanks.</DIV><DIV>&nbsp;</DIV><DIV>Edit: It is exactly the size of a scrollbar that the control is smaller by. If you download the above solution, trying commenting out line 84 of <FONT size=2>CJ_XTResizeFormView.cpp to compare what it is like.</FONT></DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 19 Oct 2007 05:39:12 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8469&amp;PID=27450&amp;title=resizeformview-in-child-frame-with-splitters#27450</guid>
  </item> 
 </channel>
</rss>