none
How to get ribbon control in MFC feature pack to process ID_WINDOW_TILE_VERT RRS feed

  • Question

  • I'm in the process of migrating an older MFC enterprise application to use ribbon controls based on the MFC feature pack.  These applications do not seem to process ID_WINDOW_TILE_VERT and other MDI tiling commands.  Is there a way around this, as these are important to our users?

    Some more information here; http://stackoverflow.com/questions/35987099/how-to-get-ribbon-control-in-mfc-feature-pack-to-process-id-window-tile-vert

    Monday, March 14, 2016 11:30 AM

Answers

  • From some experimentation, when the MFC mdi interface is based on CMDIFrameWndEx frames hosting dockable panes based CMDIChildWndEx and tabbed documents are enabled, floating windows are not available and hence neither are tiling or cascading.

    To enable tiling, simply remove the line

    EnableMDITabbedGroups(TRUE, mdiTabParams);

    from your CMainFrame::OnCreate method. The downside is you also lose your nice tabbed document UI. FWIW, I also tried calling EnableDocking(CBRS_FLOAT_MULTI) after enabling tabbed groups, but it does not make any difference.

    Update:  In order to keep the tabbed interface and split the screens, the following alternative works well to split a single horizontal view with multiple tabs into two views, with current tab in the new view.

        void SplitViews(CMDIFrameWndEx *pFrame) 
        {
            pFrame->MDITabNewGroup();
          pFrame->MDITabMoveToNextGroup(); 
        }


    Thursday, March 17, 2016 9:16 AM

All replies

  • Hi,

    Based on my search. The second version optionally does not cascade disabled MDI child windows if you specify MDITILE_SKIPDISABLED for the nType parameter.

    I am not sure if you use it?

    The MDI frame window has default handlers for the following standard Window menu commands below:

      • ID_WINDOW_TILE_VERT
      • ID_WINDOW_TILE_HORZ
      • ID_WINDOW_CASCADE
      • ID_WINDOW_ARRANGE

    So I think you need to check your code.  You also say it seems to be correct.

    If you have free time. You can see the MSDN document.

    https://msdn.microsoft.com/en-us/library/30a87cxk.aspx

    https://msdn.microsoft.com/en-us/library/98txs83a.aspx

    Best Regards,

    Hart

    Tuesday, March 15, 2016 2:30 AM
    Moderator
  • Hi Hart,

    Thanks for the reply.  On further investigation I think that the issue is that MFC ribbon derived applications are based on CMDIFrameWndEx frames hosting dockable panes based CMDIChildWndEx, as opposed to CMDIFrameWnd and CMDIChildWnd.  It seems that the docking style of window are bot by default floated in the client area and as such do not support tiling, cascading, or minimisation operations.

    To test this I've tried calling MDITile(MDITILE_VERTICAL) directly from my application to test this, and while it compiles and runs, it doesn't actually do anything.  Looking through the documentation, I'm guessing using EnableDocking(CBRS_FLOAT_MULTI) on all my views would then allow tiling of those views.

    Best regards,

    Shane

    Tuesday, March 15, 2016 7:47 AM
  • Hi,

    I am looking forward to your result, If there is any new result, please let me know.

    Best Regards,

    Hart

    Tuesday, March 15, 2016 9:27 AM
    Moderator
  • From some experimentation, when the MFC mdi interface is based on CMDIFrameWndEx frames hosting dockable panes based CMDIChildWndEx and tabbed documents are enabled, floating windows are not available and hence neither are tiling or cascading.

    To enable tiling, simply remove the line

    EnableMDITabbedGroups(TRUE, mdiTabParams);

    from your CMainFrame::OnCreate method. The downside is you also lose your nice tabbed document UI. FWIW, I also tried calling EnableDocking(CBRS_FLOAT_MULTI) after enabling tabbed groups, but it does not make any difference.

    Update:  In order to keep the tabbed interface and split the screens, the following alternative works well to split a single horizontal view with multiple tabs into two views, with current tab in the new view.

        void SplitViews(CMDIFrameWndEx *pFrame) 
        {
            pFrame->MDITabNewGroup();
          pFrame->MDITabMoveToNextGroup(); 
        }


    Thursday, March 17, 2016 9:16 AM