Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPRibbonBar tab
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPRibbonBar tab

 Post Reply Post Reply
Author
Message
Italo View Drop Down
Groupie
Groupie


Joined: 10 December 2003
Location: United States
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote Italo Quote  Post ReplyReply Direct Link To This Post Topic: CXTPRibbonBar tab
    Posted: 07 April 2006 at 1:31pm

How do I determine when a CXTPRibbonBar tab is changed?

 

Thanks,

Italo

Back to Top
Italo View Drop Down
Groupie
Groupie


Joined: 10 December 2003
Location: United States
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote Italo Quote  Post ReplyReply Direct Link To This Post Posted: 09 April 2006 at 8:05pm

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 );

}

Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 11 April 2006 at 4:27am

Instead of calling virtual methods you should send TCN_SELCHANGE and TCN_SELCHANGING notify messages to the owner.

Back to Top
Italo View Drop Down
Groupie
Groupie


Joined: 10 December 2003
Location: United States
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote Italo Quote  Post ReplyReply Direct Link To This Post Posted: 11 April 2006 at 7:07am

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.

Back to Top
Italo View Drop Down
Groupie
Groupie


Joined: 10 December 2003
Location: United States
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote Italo Quote  Post ReplyReply Direct Link To This Post Posted: 24 April 2006 at 8:54am

Can someone from CodeJock please let me know if you're going to add something like this to the Ribbon bar?

Thanks,

Italo

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: 24 April 2006 at 10:42am
Yes, we will add your code and we will add notifications to owner window.
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.063 seconds.