12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- // MyBtn.cpp : 实现文件
- //
- #include "stdafx.h"
- #include "MyBtn.h"
- #include ".\mybtn.h"
- // CMyBtn
- IMPLEMENT_DYNAMIC(CMyBtn, CButton)
- CMyBtn::CMyBtn()
- {
- m_nClick = 0;
- }
- CMyBtn::~CMyBtn()
- {
- }
- BEGIN_MESSAGE_MAP(CMyBtn, CButton)
- ON_WM_RBUTTONUP()
- ON_WM_RBUTTONDOWN()
- ON_WM_RBUTTONDBLCLK()
- ON_WM_LBUTTONUP()
- ON_WM_LBUTTONDOWN()
- ON_WM_LBUTTONDBLCLK()
- END_MESSAGE_MAP()
- // CMyBtn 消息处理程序
- void CMyBtn::OnRButtonUp(UINT nFlags, CPoint point)
- {
- // TODO: 在此添加消息处理程序代码和/或调用默认值
- m_nClick = 0;
- CButton::OnRButtonUp(nFlags, point);
- }
- void CMyBtn::OnRButtonDown(UINT nFlags, CPoint point)
- {
- // TODO: 在此添加消息处理程序代码和/或调用默认值
- m_nClick = 3;
- CButton::OnRButtonDown(nFlags, point);
- }
- void CMyBtn::OnRButtonDblClk(UINT nFlags, CPoint point)
- {
- // TODO: 在此添加消息处理程序代码和/或调用默认值
- m_nClick = 4;
- CButton::OnRButtonDblClk(nFlags, point);
- }
- void CMyBtn::OnLButtonUp(UINT nFlags, CPoint point)
- {
- // TODO: 在此添加消息处理程序代码和/或调用默认值
- //m_nClick = 0;
- CButton::OnLButtonUp(nFlags, point);
- }
- void CMyBtn::OnLButtonDown(UINT nFlags, CPoint point)
- {
- // TODO: 在此添加消息处理程序代码和/或调用默认值
- //m_nClick = 1;
- CButton::OnLButtonDown(nFlags, point);
- }
- void CMyBtn::OnLButtonDblClk(UINT nFlags, CPoint point)
- {
- // TODO: 在此添加消息处理程序代码和/或调用默认值
- //m_nClick = 2;
- CButton::OnLButtonDblClk(nFlags, point);
- }
|