Re: show/hide child splitter window




wow, i actually solved my own problem!

the trick is to set the ID of the splitter being hidden to 0, and then
back to the correct ID when being shown again

eg

//hide child splitter 1
::SetWindowLong(m_wndChildSplitter1.GetSafeHwnd(), GWL_ID, 0);
m_wndChildSplitter1.ShowWindow(SW_HIDE);

//show child splitter 2 (m_nID is the correct ID for the child
splitter)
::SetWindowLong(m_wndChildSplitter2.GetSafeHwnd(), GWL_ID, m_nID);
m_wndSplitterMain.ShowWindow(SW_SHOW);


i create both child splitter 1 and 2 with the CORRECT id (and this id
is the same for both, as they both want to live in the same pane of the
splitter parent) - you only need to set the ID to 0 when hiding the
child

and like magic, it works!



bhu Boue vidya wrote:
hi there

i have an app which has, as its main view layout, a series of nested
splitters

one of these nested splitters i want to be a 'dynamically changing
splitter layout'

that is, the user selects a different task to perform, and this
splitter child window 'changes' to show the different task layout

the way i have implemented it so far is each Task manager object
creates its own child splitter window into the same pane of the main
splitter window

thus

in mainfrm:

CSplitterWnd m_wndMainSplitter;
m_wndMainSplitter.CreateStatic(...);


in TaskMgr1:

CSplitterWnd m_wndChildSplitter;

m_wndChildSplitter.CreateStatic(
&m_wndMainSplitter,
...,
m_wndMainSplitter.IdFromRowCol(1, 0);



and similarly in TaskMgr2:

CSplitterWnd m_wndChildSplitter;

m_wndChildSplitter.CreateStatic(
&m_wndMainSplitter,
...,
m_wndMainSplitter.IdFromRowCol(1, 0);



then i use m_wndChildSplitter.ShowWindow(SW_SHOW/SW_HIDE) to try and
switch between child splitters

BUT, this doesn't work!!!

what is the best way to achieve my goals????


tia
bhu

.



Relevant Pages

  • Re: Minimum pane size in a CSplitterWnd
    ... > Dave wrote: ... >> drag the splitter past this minimum. ... You have the MFC source code for CSplitterWnd. ... to make this possible from class wizard? ...
    (microsoft.public.vc.mfc)
  • Re: problem creating 3 way split window
    ... The splitter resizes everything to properly fill all space. ... unless the splitter window is nested inside another splitter window" ... I think your problem is your call to CreateView in the 0,0 pane of the ...
    (microsoft.public.vc.mfc)
  • Re: about the size limitation on the frame
    ... You can limit the user dragging. ... use your class instead of CSplitterWnd. ... Add OnMouseMove message handler ... This makes the splitter respond to the mouse during dragging only when ...
    (microsoft.public.vc.mfc)
  • Re: outlook type interface
    ... Override CMainFrame::OnCreateClient and create a vertical splitter as ... the main child ... CSplitterWnd m_wndVert; ... > exisiting SDI Client in the space on the right ...
    (microsoft.public.vc.mfc)
  • Re: doc/view question
    ... > each doc has a splitter window like windows Explorer. ... > the splitter position, I want the doc to be able to save this info, and ... Save/restore the position in the child frame class ...
    (microsoft.public.vc.mfc)