![]() |
Mouse handlers |
Post Reply ![]() |
Author | |
gmail ![]() Groupie ![]() Joined: 24 February 2008 Status: Offline Points: 45 |
![]() ![]() ![]() ![]() ![]() Posted: 29 December 2008 at 8:47am |
I've subclassed your CXTPToolBar class and I'm trying to override mouse events like ON_WM_LBUTTONDOWN messages but my functions never gets called? I've checked all of your samples but none of them shows something like this (and I haven't found anything on your forum regarding this). Can you explain how can one achieve catching mouse click events (left/right/drag/drop) on CXTPToolBar class?
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Show all code you tried.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
gmail ![]() Groupie ![]() Joined: 24 February 2008 Status: Offline Points: 45 |
![]() ![]() ![]() ![]() ![]() |
In my MyToolBar.h file:
class CMojToolBar : public CXTPToolBar { DECLARE_DYNAMIC(CMyToolBar) public: CMyToolBar(); virtual ~CMyToolBar(); protected: DECLARE_MESSAGE_MAP() public: afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnMouseMove(UINT nFlags, CPoint point); }; In my MyToolBar.cpp file: IMPLEMENT_DYNAMIC(CMyToolBar, CXTPToolBar) CMyToolBar::CMyToolBar() { } CMyToolBar::~CMyToolBar() { } BEGIN_MESSAGE_MAP(CMyToolBar, CXTPToolBar) ON_WM_LBUTTONDOWN() ON_WM_MOUSEMOVE() END_MESSAGE_MAP() void CMyToolBar::OnLButtonDown(UINT nFlags, CPoint point) { AfxMessageBox(_T("click")); CXTPToolBar::OnLButtonDown(nFlags, point); } void CMyToolBar::OnMouseMove(UINT nFlags, CPoint point) { AfxMessageBox(_T("move")); CXTPToolBar::OnMouseMove(nFlags, point); } In my MainFrm.cpp file: CMojToolBar* ptol=(CMojToolBar*)pCommandBars->Add(_T("ptol"),xtpBarFloating); ptol->LoadToolBar(IDR_TOOLBAR); ptol->SetBarID(55); |
|
![]() |
|
gmail ![]() Groupie ![]() Joined: 24 February 2008 Status: Offline Points: 45 |
![]() ![]() ![]() ![]() ![]() |
Any update on those mouse overloaded functions?
|
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
Think you are missing:
DECLARE_XTP_COMMANDBAR(CMojToolBar) IMPLEMENT_XTP_COMMANDBAR(CMojToolBar, CXTPToolBar); |
|
![]() |
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 |