Print Page | Close Window

Ribbon Controls Sample reproduction problem

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=18424
Printed Date: 04 October 2024 at 7:25pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Ribbon Controls Sample reproduction problem
Posted By: sdancer75
Subject: Ribbon Controls Sample reproduction problem
Date Posted: 23 May 2011 at 3:44am
Trying to reproduce the ribbon control sample I get the following problem .

I am attaching the source code here  http://forum.codejock.com/uploads/4319/Ribbon1.zip - uploads/4319/Ribbon1.zip


Here the code I use :

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);

CXTPControlPopup* pControlFile = (CXTPControlPopup*)pRibbonBar->AddSystemButton(ID_MENU_FILE);
pControlFile->SetCommandBar(menu.GetSubMenu(0));
pControlFile->GetCommandBar()->SetIconSize(CSize(32, 32));
pCommandBars->GetImageManager()->SetIcons(ID_MENU_FILE);
pControlFile->SetCaption(_T("&File"));
pControlFile->SetIconId(IDB_GEAR);
UINT uCommand = {IDB_GEAR};
pCommandBars->GetImageManager()->SetIcons(IDB_GEAR, &uCommand, 1, CSize(0, 0), xtpImageNormal);
CXTPRibbonTab* pTabHome = pRibbonBar->AddTab(ID_TAB_BUTTONS);

// Tab button 1
if (pTabHome)
{
CXTPControl* pControl;

CXTPRibbonGroup* pGroup = pTabHome->AddGroup(ID_GROUP_LARGEBUTTONS);
pGroup->ShowOptionButton();

pControl = pGroup->Add(xtpControlButton, ID_BUTTON_LARGESIMPLEBUTTON);
pControl->SetStyle(xtpButtonIconAndCaptionBelow);

pControl = pGroup->Add(xtpControlButton, ID_BUTTON_LARGETOGGLEBUTTON);
pControl->SetStyle(xtpButtonIconAndCaptionBelow);

pControl = pGroup->Add(xtpControlButtonPopup, ID_BUTTON_LARGEPOPUPBUTTON);
pControl->SetStyle(xtpButtonIconAndCaptionBelow);

pControl = pGroup->Add(xtpControlSplitButtonPopup, ID_BUTTON_LARGESPLIT);
pControl->SetStyle(xtpButtonIconAndCaptionBelow);

//pControl = pGroup->Add(xtpControlButton, ID_BUTTON_LARGESPLITPOPUPBUTTON_1);
//pControl->SetStyle(xtpButtonIconAndCaptionBelow);

UINT nIDs[] = {ID_BUTTON_LARGESIMPLEBUTTON, ID_BUTTON_LARGETOGGLEBUTTON, ID_BUTTON_LARGEPOPUPBUTTON, ID_BUTTON_LARGESPLIT};
pCommandBars->GetImageManager()->SetIcons(ID_GROUP_LARGEBUTTONS, nIDs, 4, CSize(32, 32), xtpImageNormal);

}





pRibbonBar->SetCloseable(FALSE);
pRibbonBar->EnableFrameTheme();

return TRUE;
}


-------------
Just me!



Replies:
Posted By: Oleg
Date Posted: 27 May 2011 at 3:37am
See resource.h

#define IDB_GEAR                        134
#define ID_BUTTON_LARGESPLIT            134


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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