How to dock a CDockablePane to another floating CDockablePane in MFC?
Hi,
I'm working on an MFC application using the MFC App Wizard (VS-generated template with docking panes), and I'm trying to float the Class View pane and then dock the File View pane into that floating Class View pane.
Here's what I currently have inside CMFCApplication1App::OnAppAbout()
:
void CMFCApplication1App::OnAppAbout()
{
CMainFrame* mainFrm = (CMainFrame*)m_pMainWnd;
CRect rect(500, 100, 800, 800); // x=500, y=100, width=300, height=700
mainFrm->m_wndClassView.ShowPane(FALSE, FALSE, FALSE);
mainFrm->m_wndFileView.ShowPane(FALSE, FALSE, FALSE);
mainFrm->m_wndClassView.FloatPane(rect, DM_RECT);
mainFrm->m_wndFileView.EnableDocking(CBRS_ALIGN_ANY);
mainFrm->m_wndFileView.DockToFrameWindow(CBRS_ALIGN_BOTTOM, nullptr, DT_DOCK_LAST, &mainFrm->m_wndClassView);
mainFrm->m_wndClassView.ShowPane(TRUE, FALSE, TRUE);
mainFrm->m_wndFileView.ShowPane(TRUE, FALSE, TRUE);
}
The Class View floats correctly, but the File View doesn't dock into the floating Class View pane as expected. Instead, it docks back to the main frame or doesn't behave as intended.
Is there a correct way to programmatically dock one CDockablePane
into another floating CDockablePane
?
The result may looks like this
Any help or example would be greatly appreciated.
Thanks!