exbutton.cpp

来自「用大华sdk」· C++ 代码 · 共 65 行

CPP
65
字号
// ExButton.cpp : implementation file
//

#include "stdafx.h"
#include "netsdkdemo.h"
#include "ExButton.h"
#include "netsdkdemodlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CExButton

CExButton::CExButton()
{
	m_dwPTZCommand = -1;
}

CExButton::~CExButton()
{
}


BEGIN_MESSAGE_MAP(CExButton, CButton)
	//{{AFX_MSG_MAP(CExButton)
	ON_WM_LBUTTONDOWN()
	ON_WM_LBUTTONUP()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CExButton message handlers
void CExButton::SetButtonCommand(DWORD dwPTZCommand)
{
	m_dwPTZCommand = dwPTZCommand;
}

void CExButton::OnLButtonDown(UINT nFlags, CPoint point) 
{
	CButton::OnLButtonDown(nFlags, point);

	if((int)m_dwPTZCommand < 0)
	{
		return;
	}
	((CPTZPannel*)GetParent())->SendPtzControl(m_dwPTZCommand,FALSE);
	TRACE("START\n");
}

void CExButton::OnLButtonUp(UINT nFlags, CPoint point) 
{
	CButton::OnLButtonUp(nFlags, point);

	if((int)m_dwPTZCommand < 0)
	{
		return;		
	}
	((CPTZPannel*)GetParent())->SendPtzControl(m_dwPTZCommand,TRUE);
	TRACE("STOP\n");
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?