How to change the heights of the rows of a splitter proportional to the size of the windows !
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
Hi everybody, i have a problem with the sizing of the rows of a splitter. I coded a little sample with a main_splitter with 4 rows. This is how it looks at startup. http://filehosting.at/images/download.php?file=4dbf41d6c1a6e28de6a24e27e60ae9ee [^] Then the user could change the height of the rows, like this for example: http://filehosting.at/images/download.php?file=d3f0203679e34d9bb3159d231e898d89[^] But wen the user now maximize the window i want change the height proportional to the size of the window. An when he change the height of the rows in fulscreen and restoe the windows i will change the height of the rows proportional again. here is my code, i try to figure it out fore hours :doh: now but it won't work :((
/************************************************************************/ /* create the window and the splitters */ /************************************************************************/ BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { CRect spRect; CRect cr; GetClientRect(&cr); GetClientRect(&spRect); //------- Create main_splitter ---------- m_Splitter_Main.CreateStatic(this, 4, 1); m_Splitter_Main.SetRowInfo(0, spRect.Height()/4, 0); m_Splitter_Main.SetRowInfo(1, spRect.Height()/4, 0); m_Splitter_Main.SetRowInfo(2, spRect.Height()/4, 0); m_Splitter_Main.SetRowInfo(3, spRect.Height()/4, 0); m_Splitter_Main.CreateView(1, 0, RUNTIME_CLASS(CTest_01View), CSize(0, cr.Height()/4), pContext); m_Splitter_Main.CreateView(2, 0, RUNTIME_CLASS(CTest_01View), CSize(0, cr.Height()/4), pContext); m_Splitter_Child_1.CreateStatic(&m_Splitter_Main, 1, 3, WS_CHILD | WS_VISIBLE, m_Splitter_Main.IdFromRowCol(0, 0)); m_Splitter_Child_1.CreateView(0, 0, RUNTIME_CLASS(CTest_01View), CSize(cr.Width()/3, 0), pContext); m_Splitter_Child_1.CreateView(0, 1, RUNTIME_CLASS(CTest_01View), CSize(cr.Width()/3, 0), pContext); m_Splitter_Child_1.CreateView(0, 2, RUNTIME_CLASS(CTest_01View), CSize(cr.Width()/3, 0), pContext);