Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - MDI-app with ribbon cannot be maximized!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MDI-app with ribbon cannot be maximized!

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: MDI-app with ribbon cannot be maximized!
    Posted: 05 August 2006 at 7:41am
When I add a simple ribbon to my MDI-application, the right border is not painted when maximized. The same is true for the bottom border. See attached pictures. Worth mentioning is that I can click in this "unpainted" area - like the desktop. Thus, the window is not trully maximized!
 
 
 
If I remove my call to CreateRibbonBar(), the borders are painted correctly.
What can be wrong?
 
// Before call to CreateRibbonBar():
pCommandBars->SetTheme(xtpThemeRibbon);

BOOL CMainFrame::CreateRibbonBar()
{
    CXTPCommandBars* pCommandBars = GetCommandBars();

    CMenu menu;
    menu.Attach(::GetMenu(m_hWnd));
    SetMenu(NULL);

    CXTPRibbonBar* pRibbonBar = (CXTPRibbonBar*)pCommandBars->Add(_T("The Ribbon"), xtpBarTop, RUNTIME_CLASS(CXTPRibbonBar));
    if (!pRibbonBar)
    {
        return FALSE;
    }
    pRibbonBar->EnableDocking(0);
    //pRibbonBar->GetTabPaintManager()->m_bSelectOnButtonDown = FALSE;

    CXTPControlPopup* pControlFile = (CXTPControlPopup*)pRibbonBar->AddSystemButton(ID_MENU_FILE);
    pControlFile->SetCommandBar(menu.GetSubMenu(0));

    pControlFile->SetIconId(IDB_GEAR);
    UINT uCommand = {IDB_GEAR};
    pCommandBars->GetImageManager()->SetIcons(IDB_GEAR, &uCommand, 1, xtpImageNormal);

    pRibbonBar->GetQuickAccessControls()->Add(xtpControlButton, ID_FILE_SAVE);
    pRibbonBar->GetQuickAccessControls()->Add(xtpControlButton, ID_EDIT_UNDO);
    pRibbonBar->GetQuickAccessControls()->Add(xtpControlButton, ID_FILE_PRINT);
    pRibbonBar->GetQuickAccessControls()->CreateOriginalControls();


    pRibbonBar->SetCloseable(FALSE);

    pRibbonBar->EnableFrameTheme();

    return TRUE;
}

Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 06 August 2006 at 6:06am

// pRibbonBar->EnableFrameTheme();

That solves it, but then I get no "nice frame" :(. This frame looks ok in the Ribbon Sample. I'll take a look and see what else needs to be called to get the frame paint itself correctly.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.157 seconds.