Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Resizable control bar at Doc/View Collapse All
Subject Author Date
Olga Burlakova Nov 16, 2004 - 8:55 AM

Hello.

I try to create Resizable control Bar inside Child window of MDI Application(Doc/View Architecture)
My child window is CFormView.
I saw this at Your sample-MDI_InnerOuterBars.
I did override CChildFrame::OnCreate and no entry in this function while run the application.

How I can create a Resizable control Bar inside Child window?

Technical Support Nov 17, 2004 - 2:19 AM

Any dockable control bar window, regardless whether it is based on the MFC CControlBar class, or on the Prof-UIS CExtControlBar, is designed to interact with a frame window (e.g., CFrameWnd, CMDIFrameWnd, or CMDIChildWnd). It is always linked to its frame window. You cannot insert a dockable control bar into a window that is not based on CFrameWnd, like a dialog or view. Your main MDI frame window contains the MDI client area window, which is usually dark grey. It serves as a container for MDI child frames (CMDIChildWnd). These child frames are containers for their view windows and may have their own control bars. We suppose you have initialized the control bar in the CChildFrame::OnCreate method correctly and this method should be called when a child frame is created. It may not be called if you have manually removed the ON_WM_CREATE macro from the message map of the CChildFrame class. So, to clarify the problem we need to take a look at your source code. You may send it to us via e-mail.

Olga Burlakova Nov 17, 2004 - 6:33 AM

Hello.
I did check my code... Sorry, I realy forgot to add to the code OnCreate in Message Map.

I successful created a Bar. But I seems with following problem:
My Resizable Control Bar contain a dialog inside but when application start the Bar is empty.


Child window where I create a Resizable Control Bar is derived from CFormView.
I did override some function like

BOOL CDocListView::PreTranslateMessage(MSG* pMsg)
{
    if (WM_KEYFIRST <= pMsg->message && pMsg->message<= WM_KEYLAST)
    {
        if (m_hAccel && ::TranslateAccelerator(m_hWnd, m_hAccel, pMsg))
            return TRUE;
    }

    return CFormView::PreTranslateMessage(pMsg);
}
and

void CDocListView::OnSize(UINT nType, int cx, int cy)
{
    CFormView::OnSize(nType, cx, cy);
    if(bInitComplete == TRUE)
    {
        
        GetClientRect(&rect);
        rect.left = rect.left+250;
        m_ListCtrl.MoveWindow(&rect);
    }
}

And CChildFrame class code.


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

    
    
    if(    !m_wndResizableBar.Create(
            _T("Panel"),
            this,
            ID_VIEW_CHILDFRAME_BAR_FILTER
            )
            
        )
    {
        TRACE0("Failed to create Panel\n");
        return -1;        // fail to create
    }

    if( !m_wndInBarDlg.Create(
            IDD_IN_BAR_DLG_DOC,
            &m_wndResizableBar
            )
        )
    {
        TRACE0("Failed to create m_wndInBarDlg\n");
        return -1;        // fail to create
    }

    m_wndInBarDlg.ShowSizeGrip( FALSE );
    
    if( !CExtControlBar::FrameEnableDocking(this) )
    {
        ASSERT( FALSE );
        return -1;
    }
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
    if( !CExtControlBar::FrameInjectAutoHideAreas(this) )
    {
        ASSERT( FALSE );
        return -1;
    }
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)

    m_wndResizableBar.EnableDocking(CBRS_ALIGN_ANY);
    m_wndResizableBar.DockControlBar( AFX_IDW_DOCKBAR_LEFT, 1 );
    
    return 0;
}
BOOL CChildFrame::OnBarCheck(UINT nID)
{
    return CExtControlBar::DoFrameBarCheckCmd( this, nID, true );
}
void CChildFrame::OnUpdateControlBarMenu(CCmdUI* pCmdUI)
{
    CExtControlBar::DoFrameBarCheckUpdate( this, pCmdUI, true );
}



Technical Support Nov 18, 2004 - 3:00 AM

The source code looks absolutely correct. We guess that your dialog is also successfully created as a child window of the resizable control bar. It seems the dialog window is simply invisible. Please check the Visible property of your dialog resource. Alternatively you can invoke the ShowWindow method of your dialog when it is created.