Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Mouse handlers
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Mouse handlers

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


Joined: 24 February 2008
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote gmail Quote  Post ReplyReply Direct Link To This Post Topic: Mouse handlers
    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?
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: 30 December 2008 at 12:57am
Show all code you tried.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
gmail View Drop Down
Groupie
Groupie


Joined: 24 February 2008
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote gmail Quote  Post ReplyReply Direct Link To This Post Posted: 30 December 2008 at 12:27pm
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);
Back to Top
gmail View Drop Down
Groupie
Groupie


Joined: 24 February 2008
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote gmail Quote  Post ReplyReply Direct Link To This Post Posted: 07 January 2009 at 2:10pm
Any update on those mouse overloaded functions?
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 29 April 2010 at 3:03pm
Think you are missing:

DECLARE_XTP_COMMANDBAR(CMojToolBar)
IMPLEMENT_XTP_COMMANDBAR(CMojToolBar, CXTPToolBar);
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.047 seconds.