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 » CExtDynamicControlBar questions Collapse All
Subject Author Date
Michael Morrison Sep 28, 2005 - 9:04 PM

Our MDI applications’ CChildFrame contains only CExtDynamicControlBar-derived classes as views into our data - there is nothing actually rendered into the child frame itself.  How do I make the dynamic control bars take up all available space within the child frame and always dock/attach on all 4 sides?


Also, the CChildFrame inherits from CMDIChildWnd and CExtDynamicBarSite, I call CExtControlBar::FrameEnableDocking(this), CExtControlBar::FrameInjectAutoHideAreas(this), and CExtDynamicBarSite::Install(this) in the CChildFrame::OnCreate method.  I also added the OnCmdMsg code in that method as well.  The docking and movement of the bars within the child frame work fine, and my [x] button will close the windows as well.  However, I get an assert fail when I try to use the "\/" button:


CExtDynamicBarSite::eDetectedUiType_t eDUIT =


pDBS->GetDetectedUiType();


if( eDUIT == CExtDynamicBarSite::__EDUIT_UNSUPPORTED_ENVIRONMENT )


{


ASSERT( FALSE );


return false;


}


 


What does this mean?


Thanks.

Michael Morrison Sep 30, 2005 - 3:04 PM

Well, I’m not sure what is going on.  I belive I have done everything you have asked, and it still assert-fails.  Creating the tab with the AFX_IDW_PANE_FIRST identifier makes it overlay the tool bars and the dynamic windows that are created within the child window.  Even in this configuration, I am able to move things around such that I can click on the Options button and it still assert fails.  I believe this is because the following code always returns my CView-derived class within my MDI app, rather than the tabWnd (line 22163 of extcontrolbar.cpp):


#if (!defined __EXT_MFC_NO_TAB_PAGECONTAINER_CTRL)

HWND hWndCenter =

::GetDlgItem(

pDockSite->m_hWnd,

AFX_IDW_PANE_FIRST

);

 


This makes the subsequent DYNAMIC_DOWNCAST on line 22176 of extcontrolbar.cpp return NULL, and therefore eventually cause the assert-fail.

Technical Support Oct 1, 2005 - 10:01 AM

There must be only one window with the AFX_IDW_PANE_FIRST identifier inside a CChildFrame window. Our guess there are two such windows in your child frame window: the first is the view window, the second is the tab page container window. So, you need to change the design of your child frame window. There are two solutions with regard to this:

1) Do not create a view window. You need to move all the functionality of the view window to some other place. For example, the view window can be moved into a resizable control bar.

2) (We recommend this). You can move your view window into a tab page container. Create a tab page container in your CChildFrame::OnCreate() method using the following code:

CWnd * pYourAlreadyCreatedView =
        GetDlgItem( AFX_IDW_PANE_FIRST );
    ASSERT_VALID( pYourAlreadyCreatedView );
    if( ! m_wndTabPageContainer.Create(
            this,
            CRect( 0, 0, 0, 0 ),
            AFX_IDW_PANE_FIRST
            )
        )
    {
        TRACE0("Failed to create tab page container window\n");
        return -1;
    }
    pYourAlreadyCreatedView->SetParent(
        &m_wndTabPageContainer
        );
    VERIFY(
        m_wndTabPageContainer.PageInsert(
            pYourAlreadyCreatedView->m_hWnd,
            _T("Tab item text")
            )
        );


Michael Morrison Sep 30, 2005 - 9:19 AM

FYI, our application is similar in appearance to the MDI_InnerOuterBars example, where there is an outer and an inner docking site.  But per your suggestions, I have switched everything to Dynamic control bars.  Your example leaves room for the colored rectangles in the middle of the MDI child frame - we would like to do away with this, as there is nothing in this area in our application.  The only views into the data appear inside the docking control bars, so we would like them to always attach on all 4 sides and leave no client area open.


Perhaps I am misunderstanding your solution to the "Options" button problem.  Our CChildFrame inherits from CMDIChildWnd and CExtDynamicBarSite.  Are you saying it should also inherit from CExtTabPageContainerWnd, or that our Applications CView-derived class should inherit from CExtTabPageContainerWnd?  Making the CView-derived class inherit from CExtTabPageContainerWnd does not appear easily done.


I tried creating a CExtTabPageContainerWnd as a member of the CChildFrame class, and Create()ing it in the OnCreate method; I also tried adding the CExtTabPageContainerWnd as a member of the CView-derived class, but both produced the same assert failure.


Can you modify the MDI_InnerOuterBars example to work with Dynamic control bars - that will probaby give me what I need.


Thanks.

Technical Support Oct 1, 2005 - 12:43 PM

Please send us an e-mail to support@prof-uis.com so we can provide you with instructions on how to download the updated source code.

Technical Support Sep 30, 2005 - 12:08 PM

You have correctly defined the base classes for your CChildFrame class. Now, create a CExtTabPageContainerWnd window with the AFX_IDW_PANE_FIRST identifier in the CChildFrame::OnCreate() method. In fact, your CChildFrame class should be similar to the CMainFrame class of the SDI_DynamicBars sample application but derived from the CMDIChildWnd class.

As for modifying the MDI_InnerOuterBars sample application: please give us one more day to code it for you.

Michael Morrison Sep 29, 2005 - 2:43 PM

My view does not inherit from CExtTabPageContainerWnd - I was not aware this was necessary.  I’ll try that.


How about my first question about expanding the dynamic windows to take up all available client window space?


Thanks.

Technical Support Sep 30, 2005 - 12:05 PM

We answered both your questions. If you use a tab page container inside your MDI child window, then dynamic control bars will be able to become pages inside this tab page container.

Technical Support Sep 29, 2005 - 11:21 AM

The __EDUIT_UNSUPPORTED_ENVIRONMENT value is defined in the CExtControlBar::eDetectedUiType_t enumeration:

 enum eDetectedUiType_t
 {
    __EDUIT_UNSUPPORTED_ENVIRONMENT = 0, // UI is not compatible with dynamic bar site
    __EDUIT_MDI_ORDINARY   = 1, // simple MDI
    __EDUIT_MDI_WITH_TABS   = 2, // MDI with tabs
    __EDUIT_SDI_TAB_PAGE_CONTAINER = 3, // SDI with tab page container
    . . .
 }; // enum eDetectedUiType_t
This enumeration defines the types of environments supported by the dynamic bars. If you use dynamic bars in the main frame window of the SDI application or in the MDI child frame window, then the view window inside this frame should be the CExtTabPageContainerWnd class or derived from it. We guess this is not true for your MDI child frame window. Please check this issue.