CSplitter and changing views.
-
I am using an SDI application with a splitter window and I want to change the view in one of the panes depending on what menu item is selected (e.g. go from a TreeView to a ListView). It seems to work but when redrawing the whole thing looks like a dog's breakfast. When I resize the splitter it seems to then redraw okay. Any suggestions? Am I not getting the size correct? I also tried Invalidate() for the frame window but it didn't seems to be sucessful either.
... m_Split2.GetColumnInfo(1,cx,ctemp); m_Split2.GetRowInfo(0,cy,ctemp); m_Split2.DeleteView(0,1); m_Split2.CreateView(0,1,RUNTIME_CLASS(CMyListView),CSize(cx,cy),NULL); GetActiveDocument()->UpdateAllViews(NULL); ...
Many thanks:) Adam. My world tour What I do now.. "I spent a lot of my money on booze, birds and fast cars. The rest I just squandered" George Best. "I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal. -
I am using an SDI application with a splitter window and I want to change the view in one of the panes depending on what menu item is selected (e.g. go from a TreeView to a ListView). It seems to work but when redrawing the whole thing looks like a dog's breakfast. When I resize the splitter it seems to then redraw okay. Any suggestions? Am I not getting the size correct? I also tried Invalidate() for the frame window but it didn't seems to be sucessful either.
... m_Split2.GetColumnInfo(1,cx,ctemp); m_Split2.GetRowInfo(0,cy,ctemp); m_Split2.DeleteView(0,1); m_Split2.CreateView(0,1,RUNTIME_CLASS(CMyListView),CSize(cx,cy),NULL); GetActiveDocument()->UpdateAllViews(NULL); ...
Many thanks:) Adam. My world tour What I do now.. "I spent a lot of my money on booze, birds and fast cars. The rest I just squandered" George Best. "I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.http://www.codeproject.com/docview/switchingviews.asp[^] should help :) Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact" -
http://www.codeproject.com/docview/switchingviews.asp[^] should help :) Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"Ryan, You de man! Thanks :) Adam. My world tour What I do now.. "I spent a lot of my money on booze, birds and fast cars. The rest I just squandered" George Best. "I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.