selectdsp.cpp

来自「基于海康威视DVR的完整远程监控程序」· C++ 代码 · 共 92 行

CPP
92
字号
// SelectDSP.cpp : implementation file
//

#include "stdafx.h"
#include "HKVision.h"
#include "SelectDSP.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSelectDSP dialog


CSelectDSP::CSelectDSP(CWnd* pParent /*=NULL*/)
	: CDialog(CSelectDSP::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSelectDSP)
	m_ImageFile = _T("");
	m_LogFile = _T("");
	//}}AFX_DATA_INIT
}


void CSelectDSP::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSelectDSP)
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSelectDSP, CDialog)
	//{{AFX_MSG_MAP(CSelectDSP)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSelectDSP message handlers

void CSelectDSP::DSPPreset(BOOLEAN *bPreset, int iNumberOfDSPs)
{
	ZeroMemory(m_bDSPPreset, sizeof(m_bDSPPreset));

	for( int i = 0; i < iNumberOfDSPs; i++){
		m_bDSPPreset[i] = bPreset[i];
	}
	m_iTotalDSPs = iNumberOfDSPs;

}

BOOL CSelectDSP::OnInitDialog() 
{
	CDialog::OnInitDialog();

	for(int i =0; i < MAX_DSPS_SUPPORT; i++)
		GetDlgItem(IDC_CHECK1 + i)->EnableWindow(FALSE);
	
	// TODO: Add extra initialization here
	for( i =0; i < m_iTotalDSPs; i++){
		GetDlgItem(IDC_CHECK1 + i)->EnableWindow(TRUE);
		if(m_bDSPPreset[i])
			CheckDlgButton(IDC_CHECK1 + i, BST_CHECKED);   
			
	}
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}


void CSelectDSP::GetDSPsChoiced(BOOLEAN *bList)
{
	for(int i = 0; i < m_iTotalDSPs; i++){
		bList[i] = m_bDSPPreset[i];
	}
}

void CSelectDSP::OnOK() 
{
	// TODO: Add extra validation here

	for(int i =0; i < m_iTotalDSPs; i++){
		m_bDSPPreset[i] = IsDlgButtonChecked(IDC_CHECK1 + i);
	}
	
	CDialog::OnOK();
}

⌨️ 快捷键说明

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