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 do I have a "Splitter Functionality" without using CSplitterWind ? [modified]

How do I have a "Splitter Functionality" without using CSplitterWind ? [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
questioncsharpc++visual-studiodesign
4 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.
  • E Offline
    E Offline
    erajsri
    wrote on last edited by
    #1

    Hello everyone, Im creating an MFC app ( an SDI one ) that uses an explorer style User Interface. There are 3 "panes" in the Child View. All 3 of these "panes" are sized programmatically and are laid horizontally inside the Child View of the Main Frame. The "panes" are literally CWnd objects and are not CDialogs. What I want is to have a splitter functionality that is quite similar to Visual Studio 2005 where the cursor icon changes to a "splitter sizing icon" when the mouse pointer hovers above the edges of two adjacent panes. And once you click on the edge of one of these panes, it should let the user drag and size up the panes dynamically.... jus like what happens in Visual Studio 2005. How do I achieve this functionality without using a CSplitterWindow ? Cos I heard from one of ma colleagues say that u dont always need a CSplitterWindow to implement a Splitter functionality. Is it possible ? Please do give me some hints or advice and I will follow up your suggestions on MSDN and the like... thanx a lot.. wishing u all a happy new year with loads of fun coding ! :D Eraj -- modified at 0:39 Sunday 31st December, 2006

    M C 2 Replies Last reply
    0
    • E erajsri

      Hello everyone, Im creating an MFC app ( an SDI one ) that uses an explorer style User Interface. There are 3 "panes" in the Child View. All 3 of these "panes" are sized programmatically and are laid horizontally inside the Child View of the Main Frame. The "panes" are literally CWnd objects and are not CDialogs. What I want is to have a splitter functionality that is quite similar to Visual Studio 2005 where the cursor icon changes to a "splitter sizing icon" when the mouse pointer hovers above the edges of two adjacent panes. And once you click on the edge of one of these panes, it should let the user drag and size up the panes dynamically.... jus like what happens in Visual Studio 2005. How do I achieve this functionality without using a CSplitterWindow ? Cos I heard from one of ma colleagues say that u dont always need a CSplitterWindow to implement a Splitter functionality. Is it possible ? Please do give me some hints or advice and I will follow up your suggestions on MSDN and the like... thanx a lot.. wishing u all a happy new year with loads of fun coding ! :D Eraj -- modified at 0:39 Sunday 31st December, 2006

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      technojay wrote:

      Cos I heard from one of ma colleagues say that u dont always need a CSplitterWindow to implement a Splitter functionality.

      You don't need to use anyone else's code to implement any functionality. If you want it to look like VS splitters then you'll need to handle drawing the bars, responding when the mouse is over the bars, dragging the bars for resizing, etc...all the things that CSplitterWnd does for you. You could also just use regular sizeable windows and anytime they are resized by the user then you'd resize the other windows appropriately. it wouldn't look like VS splitters though :) What part are you having trouble with? Mark

      E 1 Reply Last reply
      0
      • M Mark Salsbery

        technojay wrote:

        Cos I heard from one of ma colleagues say that u dont always need a CSplitterWindow to implement a Splitter functionality.

        You don't need to use anyone else's code to implement any functionality. If you want it to look like VS splitters then you'll need to handle drawing the bars, responding when the mouse is over the bars, dragging the bars for resizing, etc...all the things that CSplitterWnd does for you. You could also just use regular sizeable windows and anytime they are resized by the user then you'd resize the other windows appropriately. it wouldn't look like VS splitters though :) What part are you having trouble with? Mark

        E Offline
        E Offline
        erajsri
        wrote on last edited by
        #3

        Hey Mark, Im quite new to MFC and this is kinda my first serious app that I was asked to do to get myself acquainted with it. So right now, although I understand the technique that you are suggesting, I am pretty clueless as to how Im gonna implement it ( for example : how to draw bars between adjacent windows, enabling them to be user dragged etc ). I am not askin for code snippets or anything like that... All I need is jus a brief description of what type of controls would be needed, what MFC classes Ill have to bring in and any specific events that I mite need to handle. If you could give me that I can reference the MSDN and try it out. hopin to hear from you soon. Eraj

        1 Reply Last reply
        0
        • E erajsri

          Hello everyone, Im creating an MFC app ( an SDI one ) that uses an explorer style User Interface. There are 3 "panes" in the Child View. All 3 of these "panes" are sized programmatically and are laid horizontally inside the Child View of the Main Frame. The "panes" are literally CWnd objects and are not CDialogs. What I want is to have a splitter functionality that is quite similar to Visual Studio 2005 where the cursor icon changes to a "splitter sizing icon" when the mouse pointer hovers above the edges of two adjacent panes. And once you click on the edge of one of these panes, it should let the user drag and size up the panes dynamically.... jus like what happens in Visual Studio 2005. How do I achieve this functionality without using a CSplitterWindow ? Cos I heard from one of ma colleagues say that u dont always need a CSplitterWindow to implement a Splitter functionality. Is it possible ? Please do give me some hints or advice and I will follow up your suggestions on MSDN and the like... thanx a lot.. wishing u all a happy new year with loads of fun coding ! :D Eraj -- modified at 0:39 Sunday 31st December, 2006

          C Offline
          C Offline
          Cristian Amarie
          wrote on last edited by
          #4

          What I did myself: - implement a separate window class; do the following: - decides if is a vertical or horizontal splitter bar, and depending on it, registers window class using LoadCursor with IDC_SIZEWE or IDC_SIZENS (I don't remember the exact names, but should be ok) - manages the draw part similar with MFC splitter (use an erase/redraw new pos. technique - study splitter code) - maintains the distance from a border (say left border if is a vert. splitter) - collaborate with parent window (read: send and receive size messages) - handles mouse messages for left button down and up, mouse move and perform the necessary painting code.

          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