![]() |
Ribbon - Frame not painting properly |
Post Reply
|
| Author | |
steve_murch
Newbie
Joined: 18 May 2007 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Topic: Ribbon - Frame not painting properlyPosted: 18 May 2007 at 8:03pm |
|
Hi Oleg and team,
First, let me say that I'm very pleased with the framework you've built.
I've followed the RibbonSample precisely, but have spent a couple hours now trying to figure out why I still have a typical Vista window frame around the Ribbon window. (Please see screenshot at: http://www.bigoven.com/images/tour/ribbon-notright.jpg).
I've gone into the .rc2 file and added the pointer to the Office2007Blue resources, and there are no compile errors. The gradients for the ribbons appear to be there and the control is working well, BUT the overall XTPFrameWnd isn't painting properly -- how do I get that to paint properly?
excerpt from CreateRibbonBar:
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};
LoadCommandBars(_T("CommandBars")); pCommandBars->GetImageManager()->SetIcons(IDB_GEAR, &uCommand, 1, xtpImageNormal); CXTPRibbonTab* pTabHome = pRibbonBar->AddTab(ID_TAB_HOME); CXTPRibbonTab* pTabRecipes = pRibbonBar->AddTab(ID_TAB_RECIPES); CXTPRibbonTab* pTabMenus = pRibbonBar->AddTab(ID_TAB_MENUS); CXTPRibbonTab* pTabPlan = pRibbonBar->AddTab(ID_TAB_PLAN); CXTPRibbonTab* pTabShop = pRibbonBar->AddTab(ID_TAB_SHOP); CXTPRibbonTab* pTabPublish = pRibbonBar->AddTab(ID_TAB_PUBLISH); CXTPRibbonGroup* pGroupClipborad = pTabHome->AddGroup(ID_GROUP_CLIPBOARD); pGroupClipborad->ShowOptionButton(); |
|
![]() |
|
steve_murch
Newbie
Joined: 18 May 2007 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 18 May 2007 at 9:15pm |
|
Disregard, please! I knew that as soon as I posted it, I'd find it. Forgot to finish out the CreateRibbon code with:
CXTPControl* pControlAbout = pRibbonBar->GetControls()->Add(xtpControlButton, ID_APP_ABOUT);
pControlAbout->SetFlags(xtpFlagRightAlign);
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(); |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |