Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Detect RibbonTab selection by user
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Detect RibbonTab selection by user

 Post Reply Post Reply
Author
Message
Alex View Drop Down
Groupie
Groupie
Avatar

Joined: 12 May 2004
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alex Quote  Post ReplyReply Direct Link To This Post Topic: Detect RibbonTab selection by user
    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
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: 18 November 2009 at 7:19am

Hi,

Please check RibbonBar sample. View class catch it.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Alex View Drop Down
Groupie
Groupie
Avatar

Joined: 12 May 2004
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alex Quote  Post ReplyReply Direct Link To This Post 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
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: 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
Back to Top
Alex View Drop Down
Groupie
Groupie
Avatar

Joined: 12 May 2004
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alex Quote  Post ReplyReply Direct Link To This Post 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
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.188 seconds.