![]() |
CXTPRibbonBar tab |
Post Reply ![]() |
Author | |
Italo ![]() Groupie ![]() Joined: 10 December 2003 Location: United States Status: Offline Points: 83 |
![]() ![]() ![]() ![]() ![]() Posted: 07 April 2006 at 1:31pm |
How do I determine when a CXTPRibbonBar tab is changed? Thanks, Italo |
|
![]() |
|
Italo ![]() Groupie ![]() Joined: 10 December 2003 Location: United States Status: Offline Points: 83 |
![]() ![]() ![]() ![]() ![]() |
I wasn’t able to find a wait to receive a tab change notification from the ribbon bar. So, I modified the XTP library as following. Please make these changes or implement a way to determine when a tab is changing and changed. Add the following to XTPRibbonBar.h protected: virtual BOOL OnBeforeTabChange(CXTPRibbonTab*) { return TRUE; } virtual void OnTabChanged(CXTPRibbonTab*) {} Change SetCurSel in XTPRibbonBar.cpp void CXTPRibbonBar::SetCurSel(int nIndex) { CXTPTabManagerItem* pItem = m_pControlTab->GetItem(nIndex); if( pItem != NULL ) { if( !OnBeforeTabChange( (CXTPRibbonTab*)pItem ) ) return; m_pControlTab->SetCurSel(nIndex); OnTabChanged( (CXTPRibbonTab*)pItem ); } } Add the following to XTPRibbonControlTab.h protected: BOOL OnBeforeItemClick(CXTPTabManagerItem* pItem); void OnItemClick(CXTPTabManagerItem* pItem); Add the following to XTPRibbonControlTab.cpp BOOL CXTPRibbonControlTab::OnBeforeItemClick(CXTPTabManagerItem* pItem) { if( !GetRibbonBar()->OnBeforeTabChange( (CXTPRibbonTab*)pItem ) ) return FALSE; return CXTPTabManager::OnBeforeItemClick(pItem); } void CXTPRibbonControlTab::OnItemClick(CXTPTabManagerItem* pItem) { CXTPTabManager::OnItemClick(pItem); GetRibbonBar()->OnTabChanged( (CXTPRibbonTab*)pItem ); } |
|
![]() |
|
ABuenger ![]() Newbie ![]() ![]() Joined: 02 February 2006 Status: Offline Points: 1075 |
![]() ![]() ![]() ![]() ![]() |
Instead of calling virtual methods you should send TCN_SELCHANGE and TCN_SELCHANGING notify messages to the owner. |
|
![]() |
|
Italo ![]() Groupie ![]() Joined: 10 December 2003 Location: United States Status: Offline Points: 83 |
![]() ![]() ![]() ![]() ![]() |
What would be nice is to implement both methods, that way inheritors and owners can handle the notification. But, I was in a hurry and didn’t have the time to do it. Hopefully the XTP team will implement this. |
|
![]() |
|
Italo ![]() Groupie ![]() Joined: 10 December 2003 Location: United States Status: Offline Points: 83 |
![]() ![]() ![]() ![]() ![]() |
Can someone from CodeJock please let me know if you're going to add something like this to the Ribbon bar? Thanks, Italo |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Yes, we will add your code and we will add notifications to owner window.
|
|
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 |