Print Page | Close Window

Detect RibbonTab selection by user

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=15638
Printed Date: 31 October 2024 at 11:39pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Detect RibbonTab selection by user
Posted By: Alex
Subject: Detect RibbonTab selection by user
Date Posted: 16 November 2009 at 9:15am

Hello,

how can I detect that the user selected a ribbon tab ?
 
I want to detect a real user interaction initiated with the mouse or keyboard ( does it work with the keyboard ? )
 
Just detecting the TCN_SELCHANGED or TCN_SELCHANGING is not sufficient.
 
Thanks in advance.
Alex


-------------
www.ANKHOR.com

Product: Xtreme ToolkitPro version 15.2.1
Platform: Windows 7 Ultimate (64bit)
Language: Visual C++ 2005 / 2008 / 2010



Replies:
Posted By: Oleg
Date Posted: 18 November 2009 at 7:19am

Hi,

Please check RibbonBar sample. View class catch it.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Alex
Date Posted: 18 November 2009 at 8:08am
Hello,
 
You're talking about the RibbonSample ?
 
void CMainFrame::OnRibbonTabChanged(NMHDR* pNMHDR, LRESULT* pRes)

{

NMXTPTABCHANGE* pNMTabChanged = (NMXTPTABCHANGE*)pNMHDR;

if (pNMTabChanged->pTab)

{

TRACE(_T("Tab Changed, Caption = %s\n"), (LPCTSTR)pNMTabChanged->pTab->GetCaption());

}

*pRes = 0;

}

Thanks, but I already found this solution.
 
But how can I be sure that the USER actually select the new tab ?
This event will also be fired when I change the tab programmatically.
 
Alex


-------------
www.ANKHOR.com

Product: Xtreme ToolkitPro version 15.2.1
Platform: Windows 7 Ultimate (64bit)
Language: Visual C++ 2005 / 2008 / 2010


Posted By: Oleg
Date Posted: 19 November 2009 at 4:20am
Hi,
 
Yes, this code. You always can set some flag before change Tab programmatically and check it in yor handler.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Alex
Date Posted: 19 November 2009 at 5:50am
Hmm, wouldn't it be more reliable to hand this information over to the program via the NMXTPTABCHANGE structure ?
 
The event will be send from within the ribbon bar as well ( and is then out of my control ).


-------------
www.ANKHOR.com

Product: Xtreme ToolkitPro version 15.2.1
Platform: Windows 7 Ultimate (64bit)
Language: Visual C++ 2005 / 2008 / 2010



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net