Restrict CDockablePane to CBRS_ALIGN_LEFT or CBRS_ALIGN_RIGHT

  • Thread starter Thread starter flaviu_
  • Start date Start date
F

flaviu_

Guest
I need to restrict a panel, derived from CDockablePane to be float only on the left or right side. But seem that it can be float anywhere, top and bottom as well. And this CDockablePane is part of a CChildFrame, not a CMainFrame.


Here is the code:

protected:
CPropertiesWnd1 m_wndPane1;



and

int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if(CMDIChildWndEx::OnCreate(lpCreateStruct) == -1)
return -1;

// TODO: Add your specialized creation code here

SetIcon(theApp.LoadIcon(IDR_MAINFRAME), FALSE);

// enable Visual Studio 2005 style docking window behavior
CDockingManager::SetDockingMode(DT_SMART);
// enable Visual Studio 2005 style docking window auto-hide behavior
EnableAutoHidePanes(CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT);

CMDIChildWndEx::m_bEnableFloatingBars = TRUE;

// Create filter window
if(! m_wndPane1.Create(_T("Properties 1"), this, CRect(0, 0, 250, 500), TRUE, TRM_PANE1ID,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_RIGHT | CBRS_FLOAT_MULTI,
AFX_CBRS_REGULAR_TABS, AFX_CBRS_FLOAT | AFX_CBRS_RESIZE | AFX_CBRS_AUTOHIDE))
{
TRACE(_T("Failed to create Filter window\n"));
return FALSE; // failed to create
}

SetDockingWindowIcons(theApp.m_bHiColorIcons);

AddPane(&m_wndPane1);
m_wndPane1.EnableDocking(CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT);
DockPane(&m_wndPane1);

m_dockManager.LoadState(theApp.GetRegSectionPath(_T("ChildFramePane")));
m_dockManager.SetDockState();

return 0;
}

But when I try to drag the pane, I can drag it anywhere:

1569657.png

Even if I setup: m_wndPane1.EnableDocking(CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT);


Seem that this line have no effect ... why ? Can you help me a little bit ?

Continue reading...
 
Back
Top