![]() |
Ribbon Controls Sample reproduction problem |
Post Reply ![]() |
Author | |
sdancer75 ![]() Groupie ![]() ![]() Joined: 08 July 2008 Location: Greece Status: Offline Points: 70 |
![]() ![]() ![]() ![]() ![]() 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!
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
See resource.h #define IDB_GEAR 134 #define ID_BUTTON_LARGESPLIT 134
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
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 |