Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Ribbon Controls Sample reproduction problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Ribbon Controls Sample reproduction problem

 Post Reply Post Reply
Author
Message
sdancer75 View Drop Down
Groupie
Groupie
Avatar

Joined: 08 July 2008
Location: Greece
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote sdancer75 Quote  Post ReplyReply Direct Link To This Post Topic: Ribbon Controls Sample reproduction problem
    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 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!
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
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.156 seconds.