Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - How to capture click event of ribbon tab
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to capture click event of ribbon tab

 Post Reply Post Reply
Author
Message
raghmod81 View Drop Down
Newbie
Newbie


Joined: 07 May 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote raghmod81 Quote  Post ReplyReply Direct Link To This Post Topic: How to capture click event of ribbon tab
    Posted: 03 June 2008 at 7:08am
I have tabs on ribbon bar. I want capture the click or double click event of this tab. How to do that? In ribbon sample I found only tab change event.
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: 03 June 2008 at 9:17am
Hi,
 
You can override CXTPRibbonBar and catch WM_LBUTTONDOWN.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
raghmod81 View Drop Down
Newbie
Newbie


Joined: 07 May 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote raghmod81 Quote  Post ReplyReply Direct Link To This Post Posted: 04 June 2008 at 1:35am
Hi,
I've created my own class which is inherited from CXTPRibbonBar class
and created its object as :
 

class CMyXTPRibbonBar : public CXTPRibbonBar{

public:

DECLARE_DYNCREATE (CMyXTPRibbonBar)

CMyXTPRibbonBar();

void myfunc();

protected:

afx_msg void OnLButtonDown(UINT nFlags, CPoint point);

afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);

DECLARE_MESSAGE_MAP()

};

in cpp file added code :

BEGIN_MESSAGE_MAP(CMyXTPRibbonBar, CXTPRibbonBar)

ON_WM_LBUTTONDOWN()

ON_WM_LBUTTONDBLCLK()

END_MESSAGE_MAP()

and object created as follows:
m_pRibbonBar = (CMyXTPRibbonBar*)pCommandBars->Add(_T("The Ribbon"), xtpBarTop, RUNTIME_CLASS(CMyXTPRibbonBar));

 

I've implemented onLButtonDown and onLButtonDblClk in my class. But these functions are not getting called.

Back to Top
raghmod81 View Drop Down
Newbie
Newbie


Joined: 07 May 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote raghmod81 Quote  Post ReplyReply Direct Link To This Post Posted: 05 June 2008 at 4:31am
Hi,
can you please solve my above mentioned problem
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 30 July 2008 at 3:12am
Did you try WM_NCLBUTTONDOWN and WM_NCLBUTTONDBLCLK?
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.156 seconds.