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. Splitter window question...

Splitter window question...

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 3 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.
  • R Offline
    R Offline
    RobJones
    wrote on last edited by
    #1

    Hello all, This should be easy but for some reason I am having troubles... I am trying to create a simple 3 view split in a SDI... I want the split to look like an upside down T, so a Left Top Pane, Right Top Pane, and a Bottom Pane (The bottom Pane needs to go from one side of the frame to the other). Here is what I am trying... if(!m_wndSplitter.CreateStatic(this, 2, 2)) return FALSE; if(!m_BottomSplitter.CreateStatic(&m_wndSplitter, 1, 1, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol(1,1))) return FALSE; if( !m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(175, 175), pContext) || !m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CRightView), CSize(100, 100), pContext)) { m_wndSplitter.DestroyWindow(); return FALSE; } if(!m_BottomSplitter.CreateView(0, 0, RUNTIME_CLASS(CBottomView), CSize(100, 100), pContext)) { m_BottomSplitter.DestroyWindow(); return FALSE; } Any ideas? Rob Whoever said nothing's impossible never tried slamming a revolving door!

    R D 2 Replies Last reply
    0
    • R RobJones

      Hello all, This should be easy but for some reason I am having troubles... I am trying to create a simple 3 view split in a SDI... I want the split to look like an upside down T, so a Left Top Pane, Right Top Pane, and a Bottom Pane (The bottom Pane needs to go from one side of the frame to the other). Here is what I am trying... if(!m_wndSplitter.CreateStatic(this, 2, 2)) return FALSE; if(!m_BottomSplitter.CreateStatic(&m_wndSplitter, 1, 1, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol(1,1))) return FALSE; if( !m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(175, 175), pContext) || !m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CRightView), CSize(100, 100), pContext)) { m_wndSplitter.DestroyWindow(); return FALSE; } if(!m_BottomSplitter.CreateView(0, 0, RUNTIME_CLASS(CBottomView), CSize(100, 100), pContext)) { m_BottomSplitter.DestroyWindow(); return FALSE; } Any ideas? Rob Whoever said nothing's impossible never tried slamming a revolving door!

      R Offline
      R Offline
      RChin
      wrote on last edited by
      #2

      Try this: Assuming that you want a view layout like this:

      //////////////////////////////////////////
      //+-----------+------------+
      //| | |
      //| | |
      //| | |
      //| | |
      //| view 1 | view 2 |
      //| | |
      //| | |
      //| | |
      //| | |
      //+-----------+------------+
      //| view 3 |
      //| |
      //+------------------------+
      //

      The trick is basically creating your splitter window within the other in order to get the right layout. The first splitter divides your window into two rows. Then using a second splitter, subdivide the upper row into two columns.. and viola if(!m_wndSplitter.CreateStatic(this, 2, 1)) return FALSE; if(!m_wndSplitterB.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol(0,0))) return FALSE; if (!m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CBottomView),CSize(100, 100), pContext)) { TRACE0("Failed to create LeftView\n"); return FALSE; } if (!m_wndSplitterB.CreateView(0, 0, RUNTIME_CLASS(CLeftView),CSize(100, 100), pContext)) { TRACE0("Failed to create LeftView\n"); return FALSE; } if (!m_wndSplitterB.CreateView(0, 1, RUNTIME_CLASS(CRightView),CSize(100, 100), pContext)) { TRACE0("Failed to create LeftView\n"); return FALSE; }


      I Dream of Absolute Zero

      1 Reply Last reply
      0
      • R RobJones

        Hello all, This should be easy but for some reason I am having troubles... I am trying to create a simple 3 view split in a SDI... I want the split to look like an upside down T, so a Left Top Pane, Right Top Pane, and a Bottom Pane (The bottom Pane needs to go from one side of the frame to the other). Here is what I am trying... if(!m_wndSplitter.CreateStatic(this, 2, 2)) return FALSE; if(!m_BottomSplitter.CreateStatic(&m_wndSplitter, 1, 1, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol(1,1))) return FALSE; if( !m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(175, 175), pContext) || !m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CRightView), CSize(100, 100), pContext)) { m_wndSplitter.DestroyWindow(); return FALSE; } if(!m_BottomSplitter.CreateView(0, 0, RUNTIME_CLASS(CBottomView), CSize(100, 100), pContext)) { m_BottomSplitter.DestroyWindow(); return FALSE; } Any ideas? Rob Whoever said nothing's impossible never tried slamming a revolving door!

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

        RobJones wrote:

        Any ideas?

        Yes. See the VIEWEX example on MSDN.


        "The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli

        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