Wrong tab height with ribbon bar and 32x32 icons |
Post Reply |
Author | |
cmarsura
Newbie Joined: 14 September 2009 Location: Italy Status: Offline Points: 4 |
Post Options
Thanks(0)
Posted: 29 December 2009 at 5:44am |
With ribbonbar, the tab manager does not supports icons of size different by 16x16. This fact is due to use of hardcoded size of icons height during tab size computation.
If you want use icons more larger than 16x16 in the tabs of ribbonbar you must modify some source files as explained here: File XTPRibbonBar.cpp - Change function body CXTPRibbonBar::GetTabsHeight() to: int CXTPRibbonBar::GetTabsHeight() const { return m_bTabsVisible ? GetRibbonPaintManager()->GetTabsHeight(const_cast<CXTPRibbonBar *>(this)) : 2; } File XTPRibbonTheme.cpp - Add: #include "XTPRibbonControlTab.h" - In class CXTPRibbonTheme::CRibbonAppearanceSet : public CXTPTabPaintManager::CAppearanceSetPropertyPageFlat change the inline GetButtonHeight() to: int GetButtonHeight(const CXTPTabManager* pTabManager) { return CAppearanceSetPropertyPageFlat::GetButtonHeight(pTabManager); } - In the CXTPRibbonTheme::FillRibbonBar() change the row: CRect rcRibbonTabs(rcRibbonClient.left, rcRibbonClient.top, rcRibbonClient.right, rcRibbonClient.top + m_nTabsHeight); to the following: CRect rcRibbonTabs(rcRibbonClient.left, rcRibbonClient.top, rcRibbonClient.right, rcRibbonClient.top + this->GetTabsHeight(pRibbonBar)); - Add the function: int CXTPRibbonTheme::GetTabsHeight(CXTPRibbonBar* pRibbonBar) const { int nTabsHeight = 0; ASSERT(pRibbonBar); CXTPTabManager* pTabManager = pRibbonBar->GetControlTab(); int nRowcount = pTabManager->GetRowCount(); nTabsHeight = nRowcount * (GetTabPaintManager()->GetAppearanceSet()->GetButtonHeight(pTabManager) -1); return nTabsHeight; } File XTPRibbonTheme.h - Add to class CXTPRibbonTheme following public declaration: virtual int GetTabsHeight(CXTPRibbonBar* pRibbonBar) const; PS: Message to Codejock developers: Can you add support to ribbonbar for icon size different by 16x16? Carlo |
|
Product: Xtreme ToolkitPro v 11.1 / Xtreme SuitePro v 10.4.2
Platform: Windows XP (32bit) - SP 3 Language: Visual Studio 2008, Visual Studio 6, Visual Basic 6.0 |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
I believe the whole idea of the paintmanager-design is to allow you to derive and change the drawing behavior in runtime.
clas CMyRibbonTheme : public CXTPRibbonTheme { ... };
pRibbon->SetTheme(new CMyRibbonTheme);
|
|
PokerMemento - http://www.pokermemento.com/
|
|
cmarsura
Newbie Joined: 14 September 2009 Location: Italy Status: Offline Points: 4 |
Post Options
Thanks(0)
|
You are right, however you must have to change the CXTPRibbonBar::GetTabsHeight() to call a function that computes at runtime the height by function call instead of accessing the member variable m_nTabsHeight that is initialized one time only.
Carlo. |
|
Product: Xtreme ToolkitPro v 11.1 / Xtreme SuitePro v 10.4.2
Platform: Windows XP (32bit) - SP 3 Language: Visual Studio 2008, Visual Studio 6, Visual Basic 6.0 |
|
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 |