Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to change the heights of the rows of a splitter proportional to the size of the windows !

How to change the heights of the rows of a splitter proportional to the size of the windows !

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialphphelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CrocodileBuck
    wrote on last edited by
    #1

    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);
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups