// SelectPhotoDlg.cpp : implementation file
//

#include "stdafx.h"
#include "ylgl.h"
#include "SelectPhotoDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// SelectPhotoDlg dialog


SelectPhotoDlg::SelectPhotoDlg(CWnd* pParent /*=NULL*/)
	: CDialog(SelectPhotoDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(SelectPhotoDlg)
	m_mode = 0;
	m_check1 = 0;
	//}}AFX_DATA_INIT
}


void SelectPhotoDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(SelectPhotoDlg)
	DDX_Radio(pDX, IDC_RADIO1, m_mode);
	DDX_Check(pDX, IDC_CHECK1, m_check1);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// SelectPhotoDlg message handlers

void SelectPhotoDlg::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData();
	CString version = _T ("Version 1.0");
	AfxGetApp()->WriteProfileInt (version, "appendname", m_check1);
	AfxGetApp()->WriteProfileInt (version, "phototype", m_mode);
	CDialog::OnOK();
}

BOOL SelectPhotoDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CString version = _T ("Version 1.0");
	m_check1=AfxGetApp()->GetProfileInt (version, "appendname", 0);
	m_mode=AfxGetApp()->GetProfileInt (version, "phototype", 0);
	UpdateData(false);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void SelectPhotoDlg::OnCancel() 
{
	// TODO: Add extra cleanup here
	UpdateData();
	CString version = _T ("Version 1.0");
	AfxGetApp()->WriteProfileInt (version, "appendname", m_check1);
	AfxGetApp()->WriteProfileInt (version, "phototype", m_mode);
	CDialog::OnOK();
}