⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 expctrl.cpp

📁 CAM-TOOL 是高效率高质量的模具制造的最好CAM解决方案。在当今的 Windows 操作环境里
💻 CPP
字号:
// ExpCtrl.cpp : implementation file
//

#include "stdafx.h"
#include "CamTool.h"
#include "CtrlSheet.h"
#include "ExpCtrl.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern BOOL ApplyEn;
/////////////////////////////////////////////////////////////////////////////
// CExpCtrl property page

IMPLEMENT_DYNCREATE(CExpCtrl, CPropertyPage)

CExpCtrl::CExpCtrl() : CPropertyPage(CExpCtrl::IDD)
{
	//{{AFX_DATA_INIT(CExpCtrl)
	m_exp = 6;
	m_aemode =  0;
	m_aperture = 0;
	m_shutter = 13;
	//}}AFX_DATA_INIT
}

CExpCtrl::~CExpCtrl()
{
}

void CExpCtrl::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CExpCtrl)
	DDX_Control(pDX, IDC_EXP_ADJ_COMP, m_expcomp);
	DDX_CBIndex(pDX, IDC_EXP_COMP, m_exp);
	DDX_Radio(pDX, IDC_AE_MASTER, m_aemode);
	DDX_CBIndex(pDX, IDC_APERTURE, m_aperture);
	DDX_CBIndex(pDX, IDC_SHUTTER, m_shutter);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CExpCtrl, CPropertyPage)
	//{{AFX_MSG_MAP(CExpCtrl)
	ON_CBN_SELCHANGE(IDC_EXP_COMP, OnExpCompChanged)
	ON_CBN_SELCHANGE(IDC_SHUTTER, OnShutterChanged)
	ON_CBN_SELCHANGE(IDC_APERTURE, OnApertureChanged)
	ON_CONTROL_RANGE(BN_CLICKED, IDC_AE_MASTER, IDC_AE_MANUAL, OnAEActionSelected)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CExpCtrl message handlers

void CExpCtrl::OnExpCompChanged() 
{
	// TODO: Add your control notification handler code here
	CPropertySheet* pSheet = STATIC_DOWNCAST(CPropertySheet, GetParent());

	CCtrlSheet* pModalSheet = DYNAMIC_DOWNCAST(CCtrlSheet, pSheet);
	if (pModalSheet != NULL)
	{
		UpdateData();
	}

	CapImgInfo[CAP_MANUAL_EXPOSURE_BIAS] = m_exp;
	ApplyEn = 1;
	AfxGetMainWnd()->GetDlgItem(IDC_APPLY)->EnableWindow(TRUE);
}

void CExpCtrl::OnShutterChanged() 
{
	// TODO: Add your control notification handler code here
	CPropertySheet* pSheet = STATIC_DOWNCAST(CPropertySheet, GetParent());

	CCtrlSheet* pModalSheet = DYNAMIC_DOWNCAST(CCtrlSheet, pSheet);
	if (pModalSheet != NULL)
	{
		UpdateData();
	}

	CapImgInfo[CAP_SHUTTER_TIME] = m_shutter;
	ApplyEn = 1;
	AfxGetMainWnd()->GetDlgItem(IDC_APPLY)->EnableWindow(TRUE);
}

void CExpCtrl::OnApertureChanged() 
{
	// TODO: Add your control notification handler code here
	CPropertySheet* pSheet = STATIC_DOWNCAST(CPropertySheet, GetParent());

	CCtrlSheet* pModalSheet = DYNAMIC_DOWNCAST(CCtrlSheet, pSheet);
	if (pModalSheet != NULL)
	{
		UpdateData();
	}

	CapImgInfo[CAP_APERTURE] = m_aperture;
	ApplyEn = 1;
	AfxGetMainWnd()->GetDlgItem(IDC_APPLY)->EnableWindow(TRUE);
}

void CExpCtrl::OnAEActionSelected() 
{
	// TODO: Add your control notification handler code here
	CPropertySheet* pSheet = STATIC_DOWNCAST(CPropertySheet, GetParent());

	CCtrlSheet* pModalSheet = DYNAMIC_DOWNCAST(CCtrlSheet, pSheet);
	if (pModalSheet != NULL)
	{
		UpdateData();
		RefreshUI();
	}

	CapImgInfo[CAP_AE_MODE] = m_aemode;
	ApplyEn = 1;
	AfxGetMainWnd()->GetDlgItem(IDC_APPLY)->EnableWindow(TRUE);
}

BOOL CExpCtrl::OnInitDialog() 
{
	CComboBox *shut_wnd, *exp_wnd;
	int i;
	char Exp_Item[13][6] = {
		"+ 2.0", "+ 1.7", "+ 1.3", "+ 1.0", "+ 0.7", "+ 0.3", 
		"  0.0", "- 0.3", "- 0.7", "- 1.0", "- 1.3", "- 1.7",
		"- 2.0"
	};
	char Shutter_Item[15][10] = {
		"8 s",
		"4 s",
		"2 s",
		"1 s",
		"1/2 s",
		"1/4 s",
		"1/8 s",
		"1/15 s",
		"1/30 s",
		"1/60 s",
		"1/125 s",
		"1/250 s",
		"1/500 s",
		"1/1000 s",
		"1/2000 s",
	};

	CPropertyPage::OnInitDialog();
	
	// TODO: Add extra initialization here
	
	exp_wnd = (CComboBox*) GetDlgItem(IDC_EXP_COMP);
	shut_wnd = (CComboBox*) GetDlgItem(IDC_SHUTTER);

	for(i=0; i < 13; i++) exp_wnd->AddString(Exp_Item[i]);
	exp_wnd->SetCurSel(m_exp);
	for(i=0; i < 15; i++) shut_wnd->AddString(Shutter_Item[i]);
	shut_wnd->SetCurSel(m_shutter);

	return TRUE;
}

void CExpCtrl::RefreshUI()
{
	CComboBox *shut_wnd, *exp_wnd, *apert_wnd;
	CStatic *desc_wnd, *apert_desc_wnd;

	exp_wnd = (CComboBox*) GetDlgItem(IDC_EXP_COMP);
	shut_wnd = (CComboBox*) GetDlgItem(IDC_SHUTTER);
	apert_wnd = (CComboBox*) GetDlgItem(IDC_APERTURE);
	desc_wnd = (CStatic*) GetDlgItem(IDS_SHUTTER);
	apert_desc_wnd = (CStatic*) GetDlgItem(IDS_APERTURE);

	shut_wnd->EnableWindow(m_aemode);
	desc_wnd->EnableWindow(m_aemode);
	apert_wnd->EnableWindow(m_aemode);
	apert_desc_wnd->EnableWindow(m_aemode);
	if(m_aemode) {
		shut_wnd->ShowWindow(SW_SHOW);
		desc_wnd->ShowWindow(SW_SHOW);
		apert_wnd->ShowWindow(SW_SHOW);
		apert_desc_wnd->ShowWindow(SW_SHOW);
	}
	else {
		shut_wnd->ShowWindow(SW_HIDE);
		desc_wnd->ShowWindow(SW_HIDE);
		apert_wnd->ShowWindow(SW_HIDE);
		apert_desc_wnd->ShowWindow(SW_HIDE);
	}
}

⌨️ 快捷键说明

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