简体   繁体   中英

MFC Feature Pack 2008 CPaneDialog as CDialogBar

I am writing software with MFC feature pack 2008. My application is based on old version this application. The old version was not written with feature pack. In the old version of this application, there are CToolBar and 3 CDialogBars. It looks as follow: 在此处输入图片说明

In my application, I changed CToolBar to CMFCToolbar and CDialogBars to CPaneDialogs. I don't know how I can set CPaneDialogs to make the same visual effect like in the old application? How can I dock CPaneDialogs to left of CMFCToolbar?

to sum up, what I did:

1) Create CPaneDialogs this way:

    if (!m_LoadDlgBar.Create(_T("DialogBar"),this, 0,IDD_REGBAR,CBRS_TOP | CBRS_FLYBY |CBRS_GRIPPER|  WS_CLIPCHILDREN,IDD_REGBAR))
    {
       TRACE0("Failed to create dialog bar\n");
       return -1;      // fail to create
    }

2) Docking:

EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_CommBar);          // this is CMFCToolbar
DockPaneLeftOf(&m_LoadDlgBar, &m_CommBar);    
DockPaneLeftOf(&m_TCPIPDlgBar, &m_LoadDlgBar);    
DockPaneLeftOf(&m_ConnDlgBar, &m_TCPIPDlgBar);    

3) Show the Pane:

m_LoadDlgBar.ShowPane(TRUE,FALSE,FALSE);

And this is result:

在此处输入图片说明

All of CPaneDialogs are dock in the same place, on the CMFCToolbar.

You initiate docking with DockPane, so instead of using CFrameWndEx::DockPane use CFrameWndEx::DockPaneLeftOf

PS: This article provides a little help, but saddly it just scratches the surface.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM