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. Switching views in a splitter pane

Switching views in a splitter pane

Scheduled Pinned Locked Moved C / C++ / MFC
delphidata-structurestutorialquestion
6 Posts 3 Posters 2 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.
  • M Offline
    M Offline
    Malcolm McMahon
    wrote on last edited by
    #1

    OK, bear with my this is my first attempt at VC (I've been using Borland) I want a split SDI window with a tree to the left and various, probably CFormView s to the right according to which node of the tree is selected. Is there a nice way to create a set of alternate views and switch between them, or is it really going to be necessary to create a brand new view every time I switch? Has anyone tried, for example, to produce an overloaded CRuntimeClass and smuggle an existing view in that way? When you overwrite a pane does the old view get deleted (as opposed to destroyed)? [Frankly I this CreateView method seems pretty perverse why on earth not take a CView argument and, if you want to use it the way Microsoft assume, put the "new" in the arguments list] :|

    T L 2 Replies Last reply
    0
    • M Malcolm McMahon

      OK, bear with my this is my first attempt at VC (I've been using Borland) I want a split SDI window with a tree to the left and various, probably CFormView s to the right according to which node of the tree is selected. Is there a nice way to create a set of alternate views and switch between them, or is it really going to be necessary to create a brand new view every time I switch? Has anyone tried, for example, to produce an overloaded CRuntimeClass and smuggle an existing view in that way? When you overwrite a pane does the old view get deleted (as opposed to destroyed)? [Frankly I this CreateView method seems pretty perverse why on earth not take a CView argument and, if you want to use it the way Microsoft assume, put the "new" in the arguments list] :|

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      Check the FormSwap app described in Dec'98 issue of MSJ (C++ QA by Paul DiLascia). In MSDN, check the 'Periodicals' section - it should be there. If not, go to msdn.microsoft.com and use the search facility. Tomasz Sowinski -- http://www.shooltz.com.pl

      M 1 Reply Last reply
      0
      • M Malcolm McMahon

        OK, bear with my this is my first attempt at VC (I've been using Borland) I want a split SDI window with a tree to the left and various, probably CFormView s to the right according to which node of the tree is selected. Is there a nice way to create a set of alternate views and switch between them, or is it really going to be necessary to create a brand new view every time I switch? Has anyone tried, for example, to produce an overloaded CRuntimeClass and smuggle an existing view in that way? When you overwrite a pane does the old view get deleted (as opposed to destroyed)? [Frankly I this CreateView method seems pretty perverse why on earth not take a CView argument and, if you want to use it the way Microsoft assume, put the "new" in the arguments list] :|

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        have you looked at the splitter section on this site?

        M 1 Reply Last reply
        0
        • T Tomasz Sowinski

          Check the FormSwap app described in Dec'98 issue of MSJ (C++ QA by Paul DiLascia). In MSDN, check the 'Periodicals' section - it should be there. If not, go to msdn.microsoft.com and use the search facility. Tomasz Sowinski -- http://www.shooltz.com.pl

          M Offline
          M Offline
          Malcolm McMahon
          wrote on last edited by
          #4

          Can't seem to find it. Search gives hundreds of matches for CSplitterWnd but no relevant for FormSwap - and the only online periodical under MSDN is the MSDN mag.

          T 1 Reply Last reply
          0
          • M Malcolm McMahon

            Can't seem to find it. Search gives hundreds of matches for CSplitterWnd but no relevant for FormSwap - and the only online periodical under MSDN is the MSDN mag.

            T Offline
            T Offline
            Tomasz Sowinski
            wrote on last edited by
            #5

            MSDN comes in two flavors: one is online at msdn.microsoft.com, searching for FormSwap works for me there. The other MSDN is on your harddisk (I'm assuming you've installed help and docs). From VC++ IDE: 1) Go to 'Help' menu 2) select 'Search...' 3) type FormSwap 4) press 'Display' Tomasz Sowinski -- http://www.shooltz.com.pl

            1 Reply Last reply
            0
            • L Lost User

              have you looked at the splitter section on this site?

              M Offline
              M Offline
              Malcolm McMahon
              wrote on last edited by
              #6

              Yes, and it was quite helpfull in clarifying the situation but it doesn't give me the kind of solution I want. What I really want to do is put an _existing_ view into a pane. To have a small set of view objects and plug in the appropriate one at the appropriate time. Unfortunately there's no "SetPane" method. This (to my mind) baddly designed CreateView method insists on creating a new view every time it's called. It looks to me like having this CRuntimeClass structure they are so pleased with they just couldn't resist using it. And, AFAIKS, it makes the call far less flexible without simplifying it a jot. If you wanted to create a new view for a pane it could just as easilly have been done something like SetPain(0, 1, new CFormView(ID_DLG), .. Subsequent to posting the query I've tracked down another improved splitter class, which allows several views to be added to the splitter and switched between written by Caroline Englebienne. I'm hopeful that will fill the bill. It still looks like a clumsy work arround for something which could so easilly have been made simple.

              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