![]() |
How to enable Scrollbar in Ribbon Bar |
Post Reply ![]() |
Author | |
lyonwhl ![]() Newbie ![]() Joined: 14 August 2008 Location: China Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() Posted: 10 November 2008 at 4:53am |
Hi
I added a gallery which includes dozens of picture items into a Ribbon group ,but the scrollbar on the gallery was unable to use. How to enable it, please help me out.
![]() the left one gallery is what I added. The right two are in the samples.
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Show some code.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
lyonwhl ![]() Newbie ![]() Joined: 14 August 2008 Location: China Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
//file: MainFrame.cpp
BOOL CMainFrame::CreateRibbonBar()
{ --- ---
CXTPRibbonTab* pTabGallery = pRibbonBar->AddTab(ID_TAB_GALLERIES);
//m_pItemsPictures is defined as CXTPControlGalleryItems* m_pItemsPictures in MainFrame.h;
m_pItemsPictures=CXTPControlGalleryItems::CreateItems(GetCommandBars(),10000);
m_pItemsPictures->SetItemSize(CSize(60,50)); for (int nCount=0;nCount<10;++nCount) { m_pItemsPictures->AddItem(new CGalleryItemThumbnail()); } CXTPRibbonGroup* pGroup = pTabGallery->AddGroup(ID_GROUP_INLINE);
pGroup->SetControlsCentering(TRUE); CXTPControlGallery* pPictureGallery=new CXTPControlGallery(); pPictureGallery->SetControlSize(CSize(200, 60)); pPictureGallery->SetResizable(); pPictureGallery->SetItemsMargin(0, 1, 0, 1); pPictureGallery->ShowLabels(FALSE); pPictureGallery->ShowScrollBar(TRUE); pPictureGallery->ShowBorders(TRUE); pPictureGallery->SetItems(m_pItemsPictures); pGroup->Add(pPictureGallery,10000); --- |
|
![]() |
|
lyonwhl ![]() Newbie ![]() Joined: 14 August 2008 Location: China Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
//added by lyonwhl }; CGalleryItemThumbnail::CGalleryItemThumbnail()
{ m_strPictureFile=_T("E:\\pic\\lack.bmp"); } void CGalleryItemThumbnail::Draw(CDC *pDC, CXTPControlGallery *pGallery, CRect rcItem, BOOL bEnabled, BOOL bSelected, BOOL bPressed, BOOL bChecked) { CXTPPaintManager* pPaintManager = pGallery->GetPaintManager(); pPaintManager->DrawRectangle(pDC, rcItem, bSelected, FALSE, bEnabled, bChecked, FALSE, xtpBarTypePopup, xtpBarPopup);
CWinImage img; img.load(m_strPictureFile.GetString()); RECT rc={rcItem.left,rcItem.top,rcItem.right,rcItem.bottom}; img.draw(pDC->m_hDC,rc); } |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Guess problem that this control is disabled. Add some update handler for control and enable it.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
lyonwhl ![]() Newbie ![]() Joined: 14 August 2008 Location: China Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
Hi oleq, Thank you very much for your advice. I added a message macro,ON_UPDATE_COMMAND_UI(ID_GALLERY_THUMBNAILS,OnEnableButton),then it works.
|
|
![]() |
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 |