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