Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

OutlawTornNMT

Splitter Window Resize Issues

This topic is 5227 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok here''s my first snippet of code: BOOL fRet = FALSE; CRect cr; GetWindowRect(&cr); if(!m_wndSplit.CreateStatic(this, 2, 1, WS_CHILD | WS_VISIBLE, AFX_IDW_PANE_FIRST)) goto bail; m_wndSplit.SetRowInfo(0, 13*(cr.Height())/16, 10); m_wndSplit.SetRowInfo(1, 3*(cr.Height())/16, 10); if(!m_wndSplit.CreateView(1, 0, RUNTIME_CLASS(CDirCmdView), CSize(0, cr.Height()/2), pContext)) goto bail; if(!m_wndSplit2.CreateStatic(&m_wndSplit, 1, 2, WS_CHILD | WS_VISIBLE | WS_BORDER, m_wndSplit.IdFromRowCol(0, 0))) goto bail; if(!m_wndSplit2.CreateView(0, 0, RUNTIME_CLASS(CMapView), CSize(cr.Width()/2, cr.Height()/2), pContext)) goto bail; m_wndSplit2.SetColumnInfo(0, 7*(cr.Width())/8, 10); if(!m_wndSplit2.CreateView(0, 1, RUNTIME_CLASS(CStatusView), CSize(cr.Width()/2, cr.Height()/2), pContext)) goto bail; m_wndSplit2.SetColumnInfo(1, cr.Width()/8, 10); m_wndSplit.RecalcLayout(); m_wndSplit2.RecalcLayout(); fRet = TRUE; bail: return fRet; This works peachy until I add the OnSize message handler, and add this code: CRect cr; GetWindowRect(&cr); m_wndSplit.SetRowInfo(0, 13*(cr.Height())/16, 10); m_wndSplit.SetRowInfo(1, 3*(cr.Height())/16, 10); m_wndSplit2.SetColumnInfo(0, 7*(cr.Width())/8, 10); m_wndSplit2.SetColumnInfo(1, cr.Width()/8, 10); m_wndSplit.RecalcLayout(); m_wndSplit2.RecalcLayout(); Then I get an access violation error on the very first CreateStatic function. What gives? All I want to do is take my top portion of code, and make it so whenever the window is resize that the aspect ratio of all the childviews stays the same... Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!