Print Page | Close Window

Ribbon - Frame not painting properly

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=7180
Printed Date: 03 March 2025 at 4:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Ribbon - Frame not painting properly
Posted By: steve_murch
Subject: Ribbon - Frame not painting properly
Date Posted: 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 - 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();




Replies:
Posted By: steve_murch
Date 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();




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net