// PropertyPage.cpp : implementation file
//

#include "stdafx.h"
#include "sample.h"
#include "PropertyPage.h"
#include "SampleDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CPropertyPage1 property page

IMPLEMENT_DYNCREATE(CPropertyPage1, CPropertyPage)

CPropertyPage1::CPropertyPage1() : CPropertyPage(CPropertyPage1::IDD)
{
	//{{AFX_DATA_INIT(CPropertyPage1)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT

	m_pOwnerDlg = NULL;
}

CPropertyPage1::~CPropertyPage1()
{
}

void CPropertyPage1::SetOwnerDlg (CSampleDlg* pOwnerDlg)
{
	ASSERT_VALID (pOwnerDlg);
	ASSERT(pOwnerDlg->GetSafeHwnd () != NULL);

	m_pOwnerDlg = pOwnerDlg;
}

void CPropertyPage1::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPropertyPage1)
	DDX_Control(pDX, IDC_PROP_IMAGESIZE, m_cbImageSize);
	DDX_Control(pDX, IDC_PROP_IMAGEQUALITY, m_cbImageQuality);
	DDX_Control(pDX, IDC_PROP_WHITEBALANCE, m_cbWhiteBalance);
	DDX_Control(pDX, IDC_PROP_FLASHMODE, m_cbFlashMode);
	DDX_Control(pDX, IDC_PROP_REDEYE, m_cbRedEye);
	DDX_Control(pDX, IDC_PROP_FLASHCOMP, m_cbFlashComp);
	DDX_Control(pDX, IDC_PROP_ISOSPEED, m_cbISOSpeed);
	DDX_Control(pDX, IDC_PROP_AV, m_cbAV);
	DDX_Control(pDX, IDC_PROP_TV, m_cbTV);
	DDX_Control(pDX, IDC_PROP_EXPOSURECOMP, m_cbExposureComp);
	DDX_Control(pDX, IDC_PROP_AFMODE, m_cbAFMode);
	DDX_Control(pDX, IDC_PROP_FOCUSINGZONE, m_cbFocusingZone);
	DDX_Control(pDX, IDC_PROP_METERINGMODE, m_cbMeteringMode);
	DDX_Control(pDX, IDC_PROP_SHOOTMODE, m_cbShootingMode);
	DDX_Control(pDX, IDC_PROP_BATTERY, m_cbBatteryLevel);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPropertyPage1, CPropertyPage)
 	//{{AFX_MSG_MAP(CPropertyPage1)
	ON_CBN_SELENDOK(IDC_PROP_IMAGESIZE, OnSelendokPropImageSize)
	ON_CBN_SELENDOK(IDC_PROP_IMAGEQUALITY, OnSelendokPropImageQuality)
	ON_CBN_SELENDOK(IDC_PROP_WHITEBALANCE, OnSelendokPropWhiteBalance)
	ON_CBN_SELENDOK(IDC_PROP_FLASHMODE, OnSelendokPropFlashMode)
	ON_CBN_SELENDOK(IDC_PROP_REDEYE, OnSelendokPropRedEye)
	ON_CBN_SELENDOK(IDC_PROP_FLASHCOMP, OnSelendokPropFlashComp)
	ON_CBN_SELENDOK(IDC_PROP_ISOSPEED, OnSelendokPropISOSpeed)
	ON_CBN_SELENDOK(IDC_PROP_AV, OnSelendokPropAV)
	ON_CBN_SELENDOK(IDC_PROP_TV, OnSelendokPropTV)
	ON_CBN_SELENDOK(IDC_PROP_EXPOSURECOMP, OnSelendokPropExposureComp)
	ON_CBN_SELENDOK(IDC_PROP_AFMODE, OnSelendokPropAFMode)
	ON_CBN_SELENDOK(IDC_PROP_FOCUSINGZONE, OnSelendokPropFocusingZone)
	ON_CBN_SELENDOK(IDC_PROP_METERINGMODE, OnSelendokPropMeteringMode)
	ON_CBN_SELENDOK(IDC_PROP_SHOOTMODE, OnSelendokPropShootingMode)
	ON_CBN_SELENDOK(IDC_PROP_BATTERY, OnSelendokPropBatteryLevel)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPropertyPage1 message handlers

void CPropertyPage1::OnSelendokPropImageSize()
{
	UpdateData (TRUE);

	ASSERT_VALID (m_pOwnerDlg);
	m_pOwnerDlg->SetProperty (PS_ImageSize, m_cbImageSize);
}
//*****************************************************************************
void CPropertyPage1::OnSelendokPropImageQuality()
{
	UpdateData (TRUE);

	ASSERT_VALID (m_pOwnerDlg);
	m_pOwnerDlg->SetProperty (PS_JpegQuality, m_cbImageQuality);
}
//*****************************************************************************
void CPropertyPage1::OnSelendokPropWhiteBalance()
{
	UpdateData (TRUE);

	ASSERT_VALID (m_pOwnerDlg);
	m_pOwnerDlg->SetProperty (PS_WBmode, m_cbWhiteBalance);
}
//*****************************************************************************
void CPropertyPage1::OnSelendokPropFlashMode()
{
	UpdateData (TRUE);

	ASSERT_VALID (m_pOwnerDlg);
	m_pOwnerDlg->SetProperty (PS_FlashMode,	m_cbFlashMode);
}
//*****************************************************************************
void CPropertyPage1::OnSelendokPropRedEye()
{
	UpdateData (TRUE);

	ASSERT_VALID (m_pOwnerDlg);
	m_pOwnerDlg->SetProperty (PS_RedEyeMode,	m_cbRedEye);
}
//*****************************************************************************
void CPropertyPage1::OnSelendokPropFlashComp ()
{
	UpdateData (TRUE);

	ASSERT_VALID (m_pOwnerDlg);
	m_pOwnerDlg->SetProperty (PS_FlashComp,	m_cbFlashComp);
}
//*****************************************************************************
void CPropertyPage1::OnSelendokPropISOSpeed()
{
	UpdateData (TRUE);

	ASSERT_VALID (m_pOwnerDlg);
	m_pOwnerDlg->SetProperty (PS_ISOSpeed,	m_cbISOSpeed);
}
//*****************************************************************************
void CPropertyPage1::OnSelendokPropAV()
{
	UpdateData (TRUE);

	ASSERT_VALID (m_pOwnerDlg);
	m_pOwnerDlg->SetProperty (PS_Av,	m_cbAV);
}
//*****************************************************************************
void CPropertyPage1::OnSelendokPropTV()
{
	UpdateData (TRUE);

	ASSERT_VALID (m_pOwnerDlg);
	m_pOwnerDlg->SetProperty (PS_Tv,	m_cbTV);
}
//*****************************************************************************
void CPropertyPage1::OnSelendokPropExposureComp()
{
	UpdateData (TRUE);

	ASSERT_VALID (m_pOwnerDlg);
	m_pOwnerDlg->SetProperty (PS_ExposureComp, m_cbExposureComp);
}
//*****************************************************************************
void CPropertyPage1::OnSelendokPropAFMode()
{
	UpdateData (TRUE);

	ASSERT_VALID (m_pOwnerDlg);
	m_pOwnerDlg->SetProperty (PS_AFMode,	m_cbAFMode);
}
//*****************************************************************************
void CPropertyPage1::OnSelendokPropFocusingZone()
{
	UpdateData (TRUE);

	ASSERT_VALID (m_pOwnerDlg);
	m_pOwnerDlg->SetProperty (PS_FocusingZone,	m_cbFocusingZone);
}
//*****************************************************************************
void CPropertyPage1::OnSelendokPropMeteringMode()
{
	UpdateData (TRUE);

	ASSERT_VALID (m_pOwnerDlg);
	m_pOwnerDlg->SetProperty (PS_MeteringMode, m_cbMeteringMode);
}
//*****************************************************************************
void CPropertyPage1::OnSelendokPropShootingMode()
{
	UpdateData (TRUE);

	ASSERT_VALID (m_pOwnerDlg);
	m_pOwnerDlg->SetProperty (PS_ShootingMode,	m_cbShootingMode);
}
//*****************************************************************************
void CPropertyPage1::OnSelendokPropBatteryLevel()
{
	UpdateData (TRUE);

	ASSERT_VALID (m_pOwnerDlg);
	m_pOwnerDlg->SetProperty (PS_BatteryLevel, m_cbBatteryLevel);
}
