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. Want to add a static horizontal splitter to an already created view in sdi app

Want to add a static horizontal splitter to an already created view in sdi app

Scheduled Pinned Locked Moved C / C++ / MFC
c++businesshelp
2 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.
  • U Offline
    U Offline
    User 5695619
    wrote on last edited by
    #1

    I have a MFC SDI app which has a single view with a bunch of controls. As an enhancement, there is a suggestion to add splitter pane to divide the existing view into 2 horizontal parts so that user can adjust panes to view according to their requirement. So, my splitter would be of 2 rows and 1 col. But problem which I am facing is - all implementation which I have seen till now for CSplitterWnd create a new Wnd or View or store each "pane" in the view. But in my case, there's a single view which has already been created(and there's already huge business logic written in Child View class) and it would be a pain to actually partition that view into 2 views and then add the relevant code. Is there any way I can use same view to add a horizontal static splitter with 2 panes so that 2 panes will actually contain diff controls but part of just 1 view file. Thanks Amit

    _ 1 Reply Last reply
    0
    • U User 5695619

      I have a MFC SDI app which has a single view with a bunch of controls. As an enhancement, there is a suggestion to add splitter pane to divide the existing view into 2 horizontal parts so that user can adjust panes to view according to their requirement. So, my splitter would be of 2 rows and 1 col. But problem which I am facing is - all implementation which I have seen till now for CSplitterWnd create a new Wnd or View or store each "pane" in the view. But in my case, there's a single view which has already been created(and there's already huge business logic written in Child View class) and it would be a pain to actually partition that view into 2 views and then add the relevant code. Is there any way I can use same view to add a horizontal static splitter with 2 panes so that 2 panes will actually contain diff controls but part of just 1 view file. Thanks Amit

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      This is how the splitter works. First there is a view. You create a splitter in that view. Now you have to create 2 views, one for each pane. The initial parent view now only hosts the splitter and does nothing more. In your case, after you create the splitter, create two instances of the Child View class, one in each pane.

      «_Superman_» I love work. It gives me something to do between weekends.
      Microsoft MVP (Visual C++)

      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