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 » Dialog resource template in a CExtControlBar Collapse All
Subject Author Date
Alexander Kool Dec 6, 2006 - 10:15 AM

Is there an easy way to place a dialog resource template in a CExtControlBar?
Maybe also an example of a propertypage like dialog (tab control with
a changing dialog page).

best regards,
Alexander

Technical Support Dec 6, 2006 - 12:11 PM

Here is the FAQ article that may be helpful:

I know how to add a resizable control bar to my program but I do not know how to add a dialog into it

As for the tab control, you could use CExtTabPageContainerWnd. You can see how to use it in the ProfUIS_Controls sample (the page Tab Containers).

Alexander Kool Dec 6, 2006 - 1:35 PM

Thanks for the reference.
I tried it, as far as I understand. The text is a bit contradictionary.
It says: "dialog window inside the control bar".
The example code:
if( !m_wndInBarDlg.Create(
CYourDialog::IDD,
&m_wndResizableBar
)
)
{
TRACE0("Failed to create m_wndInBarDlg\n");
return -1;
}
m_wndInBarDlg.ShowSizeGrip( FALSE );

I think your code assumes that it is outside the
and m_wndInBarDlg refers to the resizable control bar.

When I implement it in a CExtControlBar::CreateDlgCtrlBar function,
The dialog shows at application start-up, as a regular modeless dialog.
It seems to ignore that I gave it the CExtControlBar as a parent window.

My code is:
int CDlgCtrlBar::CreateDlgCtrlBar(CFrameWnd* pParentWnd, UINT nDialogTemplateID)
{
    if(    !Create(
        NULL, // _T("Optional control bar caption"),
        pParentWnd,
        ID_VIEW_RESIZABLEBAR_DLG,
        WS_CHILD|WS_VISIBLE|CBRS_TOP|CBRS_GRIPPER
        |CBRS_TOOLTIPS
        |CBRS_FLYBY
        |CBRS_SIZE_DYNAMIC
        |CBRS_HIDE_INPLACE
        )
        )
    {
        TRACE0("Failed to create m_wndResizableBarDlg\n");
        return -1;        // fail to create
    }

    if (!m_Dialog.Create(nDialogTemplateID, this))
    {
        TRACE0("Failed to create the Dialog\n");
        return -1;        // fail to create
    }

    m_Dialog.ShowSizeGrip(FALSE);

    EnableDocking( CBRS_ALIGN_ANY );
    DockControlBar(AFX_IDW_DOCKBAR_RIGHT, 2, pParentWnd);
    return 0;
}

Any sugestions?
Maybe the example can be made more clear with actual code.

Best regards,
Alexander.

Technical Support Dec 7, 2006 - 1:37 PM

Please check the dialog template in the resources. It should have the Child and None values for the style and border parameters.