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!
http://www.bostream.nu/krisse/ribbon_maximized_gap.zip - http://www.bostream.nu/krisse/ribbon_maximized_gap.zip
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; }
|