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. Little Splitter problem !

Little Splitter problem !

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 Posts 2 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, i coded a sdi project with 3 horizonta splitters, no problem. But now i want a vertical Splitter in the first pane,

    ********************
    *------*-----------*
    *------*-----------*
    ********************
    *------------------*
    *------------------*
    *------------------*
    ********************
    *------------------*
    *------------------*
    *------------------*
    ********************

    but this doesn't wotk :doh: :(( I don't get an error, but the chilsSplitter isn't shown ! Here is my code:

    BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
    {
    CRect cr;
    GetClientRect(&cr);

    m\_Splitter\_Main.CreateStatic(this, 3, 1);
    m\_Splitter\_Main.CreateView(0, 0, RUNTIME\_CLASS(CTest\_01View), CSize(cr.Width(), cr.Height()/3), pContext); 
    m\_Splitter\_Main.CreateView(1, 0, RUNTIME\_CLASS(CTest\_01View), CSize(cr.Width(), cr.Height()/3), pContext);  
    m\_Splitter\_Main.CreateView(2, 0, RUNTIME\_CLASS(CTest\_01View), CSize(cr.Width(), cr.Height()/3), pContext);
    
    m\_Splitter\_Child\_1.CreateStatic(&m\_Splitter\_Main, 1, 2, WS\_CHILD | WS\_VISIBLE, m\_Splitter\_Main.IdFromRowCol(0, 0));
    m\_Splitter\_Child\_1.CreateView(0, 0, RUNTIME\_CLASS(CTest\_01View), CSize(100, 0), pContext);
    m\_Splitter\_Child\_1.CreateView(0, 1, RUNTIME\_CLASS(CTest\_01View), CSize(0, 0), pContext);
    
    return TRUE;	
    

    }

    Many, many thanx for your help ! Best regards Croc

    D 1 Reply Last reply
    0
    • C CrocodileBuck

      Hi, i coded a sdi project with 3 horizonta splitters, no problem. But now i want a vertical Splitter in the first pane,

      ********************
      *------*-----------*
      *------*-----------*
      ********************
      *------------------*
      *------------------*
      *------------------*
      ********************
      *------------------*
      *------------------*
      *------------------*
      ********************

      but this doesn't wotk :doh: :(( I don't get an error, but the chilsSplitter isn't shown ! Here is my code:

      BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
      {
      CRect cr;
      GetClientRect(&cr);

      m\_Splitter\_Main.CreateStatic(this, 3, 1);
      m\_Splitter\_Main.CreateView(0, 0, RUNTIME\_CLASS(CTest\_01View), CSize(cr.Width(), cr.Height()/3), pContext); 
      m\_Splitter\_Main.CreateView(1, 0, RUNTIME\_CLASS(CTest\_01View), CSize(cr.Width(), cr.Height()/3), pContext);  
      m\_Splitter\_Main.CreateView(2, 0, RUNTIME\_CLASS(CTest\_01View), CSize(cr.Width(), cr.Height()/3), pContext);
      
      m\_Splitter\_Child\_1.CreateStatic(&m\_Splitter\_Main, 1, 2, WS\_CHILD | WS\_VISIBLE, m\_Splitter\_Main.IdFromRowCol(0, 0));
      m\_Splitter\_Child\_1.CreateView(0, 0, RUNTIME\_CLASS(CTest\_01View), CSize(100, 0), pContext);
      m\_Splitter\_Child\_1.CreateView(0, 1, RUNTIME\_CLASS(CTest\_01View), CSize(0, 0), pContext);
      
      return TRUE;	
      

      }

      Many, many thanx for your help ! Best regards Croc

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      You might also need:

      void CMainFrame::OnSize(UINT nType, int cx, int cy)
      {
      if(::IsWindow(m_Splitter_Main.m_hWnd) && ::IsWindow(m_Splitter_Child_1.m_hWnd))
      {
      m_Splitter_Main.SetRowInfo(0, cy/3, 10);
      m_Splitter_Main.SetRowInfo(1, cy/3, 10);
      m_Splitter_Main.SetRowInfo(2, cy/3, 10);

          m\_Splitter\_Child\_1.SetColumnInfo(0, cx/2, 10);
          m\_Splitter\_Child\_1.SetColumnInfo(1, cx/2, 10);
      
          RecalcLayout();
      }
      

      }

      You could probably call SetRowInfo() and SetColumnInfo() at the end of OnCreateClient(), but I did not try.

      "Love people and use things, not love things and use people." - Unknown

      "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

      C 1 Reply Last reply
      0
      • D David Crow

        You might also need:

        void CMainFrame::OnSize(UINT nType, int cx, int cy)
        {
        if(::IsWindow(m_Splitter_Main.m_hWnd) && ::IsWindow(m_Splitter_Child_1.m_hWnd))
        {
        m_Splitter_Main.SetRowInfo(0, cy/3, 10);
        m_Splitter_Main.SetRowInfo(1, cy/3, 10);
        m_Splitter_Main.SetRowInfo(2, cy/3, 10);

            m\_Splitter\_Child\_1.SetColumnInfo(0, cx/2, 10);
            m\_Splitter\_Child\_1.SetColumnInfo(1, cx/2, 10);
        
            RecalcLayout();
        }
        

        }

        You could probably call SetRowInfo() and SetColumnInfo() at the end of OnCreateClient(), but I did not try.

        "Love people and use things, not love things and use people." - Unknown

        "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

        C Offline
        C Offline
        CrocodileBuck
        wrote on last edited by
        #3

        Thx very much ! :-D Now it works ! Best regards Croc ! :-D :-D :-D :-D

        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