1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// SISJogButton.cpp : implementation file
//
 
#include "stdafx.h"
#include "SISJogButton.h"
 
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
 
/////////////////////////////////////////////////////////////////////////////
// CSISJogButton
 
CSISJogButton::CSISJogButton()
{
    m_strMessageDown    = _T("");
    m_strMessageUp        = _T("");
 
    m_nMessageDown        = -1;
    m_nMessageUp        = -1;
}
 
CSISJogButton::~CSISJogButton()
{
}
 
 
BEGIN_MESSAGE_MAP(CSISJogButton, CButton)
    //{{AFX_MSG_MAP(CSISJogButton)
    ON_WM_LBUTTONDOWN()
    ON_WM_LBUTTONUP()
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()
 
/////////////////////////////////////////////////////////////////////////////
// CSISJogButton message handlers
 
void CSISJogButton::OnLButtonDown(UINT nFlags, CPoint point) 
{
    // TODO: Add your message handler code here and/or call default
    if (m_nMessageDown == -1)
        m_pJ2M->SendMessageToParent((LPCTSTR)m_strMessageDown);
    else
        m_pJ2M->SendMessageToParent(m_nMessageDown);
 
    CButton::OnLButtonDown(nFlags, point);
}
 
void CSISJogButton::OnLButtonUp(UINT nFlags, CPoint point) 
{
    // TODO: Add your message handler code here and/or call default
    if (m_nMessageUp == -1)
        m_pJ2M->SendMessageToParent((LPCTSTR)m_strMessageUp);
    else
        m_pJ2M->SendMessageToParent(m_nMessageUp);
    
    CButton::OnLButtonUp(nFlags, point);
}