Tabbed MDI issue when toolbar layout changed.

2014-05-01
2014-05-02
  • xjzhang1979
    xjzhang1979
    2014-05-01

    Hi David, I met another issue.

    I added another toolbar in CMainFrame::SetupToolBar().

    The new toolbar is added to the same row as the main toolbar.

    And I use a Tabbed MDI. When I drag my new toolbar to a new row below the main toolbar.

    The view of current tab will disappear, it displays a grey background(please refer to the attached snapshot).

    The issue can be reproduced with sample "DockTabbedMDI".

    Could you please help check whether it's a bug or I missed something?
    Thank you.

     
    Last edit: xjzhang1979 2014-05-01
    Attachments
  • David
    David
    2014-05-02

    Hi,

    Yes this one is a bug. The fix is to modify CFrame::OnRBNHeightChange as follows:

    inline LRESULT CFrame::OnRBNHeightChange(LPNMHDR pNMHDR)
    {
        // Notifcation sent by Rebar
    
        UNREFERENCED_PARAMETER(pNMHDR);
    
        RecalcLayout();
        RedrawWindow();
    
        return 0L;
    }
    

    The updated code replaces Invalidate with RedrawWindow. The Invalidate was painting an incorrect background color.

    You could make this change manually to the code, or override OnRBNHeightChange in CMainFrame, or download the latest SVN update.

    Best regards,
    David

     
  • xjzhang1979
    xjzhang1979
    2014-05-02

    David, thank you, the issue is resolved by your suggestion.