propertydlg.cpp

来自「基于SDK的图像采集程序」· C++ 代码 · 共 86 行

CPP
86
字号
// PropertyDlg.cpp : implementation file
//

#include "stdafx.h"
#include "multicard.h"
#include "PropertyDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CPropertyDlg dialog


CPropertyDlg::CPropertyDlg(int iCardID, CWnd* pParent /*=NULL*/)
	: CDialog(CPropertyDlg::IDD, pParent),
	m_iCardID(iCardID)
{
	//{{AFX_DATA_INIT(CPropertyDlg)
	m_id = -1;
	//}}AFX_DATA_INIT
}


void CPropertyDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPropertyDlg)
	DDX_Radio(pDX, IDC_RADIO1, m_id);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPropertyDlg, CDialog)
	//{{AFX_MSG_MAP(CPropertyDlg)
	ON_BN_CLICKED(IDC_DISPLAY_PROPERTY, OnDisplayProperty)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPropertyDlg message handlers

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

	char szCaption[20];
	sprintf(szCaption, "%d号卡: 枚举属性页", m_iCardID);
	SetWindowText(szCaption);
	
	// TODO: Add extra initialization here
	m_id = -1;

	BOOL bSupport;
	for(int i=11; i>=0; i--)
	{
		DSStream_IsPropertyExist(m_iCardID, (PropertyDialog)i, &bSupport);
		GetDlgItem(IDC_RADIO1+i)->EnableWindow(bSupport);
		if(bSupport)
			m_id = i;
	}
	UpdateData(FALSE);

	if(m_id==-1)
		GetDlgItem(IDC_DISPLAY_PROPERTY)->EnableWindow(FALSE);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CPropertyDlg::OnDisplayProperty() 
{
	UpdateData();

	if(PropertyDlg_VideoPreviewPin == (PropertyDialog)m_id)
		DSStream_DisconnectPin(m_iCardID, PREVIEW);

	DSStream_DisplayPropertyDialogs(m_iCardID, (PropertyDialog)m_id, m_hWnd);

	if(PropertyDlg_VideoPreviewPin == (PropertyDialog)m_id)
		DSStream_ConnectPin(m_iCardID, PREVIEW);
}

⌨️ 快捷键说明

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