// 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 = 2; m_check1 = 0; //}}AFX_DATA_INIT } void SelectPhotoDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(SelectPhotoDlg) DDX_Check(pDX, IDC_CHECK1, m_check1); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(SelectPhotoDlg, CDialog) //{{AFX_MSG_MAP(SelectPhotoDlg) ON_BN_CLICKED(IDC_RADIO1, OnRADIO1) ON_BN_CLICKED(IDC_RADIO2, OnRADIO2) ON_BN_CLICKED(IDC_RADIO3, OnRADIO3) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // SelectPhotoDlg message handlers void SelectPhotoDlg::OnOK() { // TODO: Add extra validation here UpdateData(); AfxGetApp()->WriteProfileInt (LYFZVERSION, "appendname", m_check1); AfxGetApp()->WriteProfileInt (LYFZVERSION, "phototype", m_mode); CDialog::OnOK(); } BOOL SelectPhotoDlg::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here m_check1=AfxGetApp()->GetProfileInt (LYFZVERSION, "appendname", 0); m_mode=AfxGetApp()->GetProfileInt (LYFZVERSION, "phototype", 0); int nBoth = AfxGetApp()->GetProfileInt (LYFZVERSION, "SelPhotoModel", 0); GetDlgItem(IDC_RADIO3)->ShowWindow(nBoth); switch(m_mode) { case 2: ((CButton*)GetDlgItem(IDC_RADIO1))->SetCheck(1); break; case 1: ((CButton*)GetDlgItem(IDC_RADIO2))->SetCheck(1); break; case 0: ((CButton*)GetDlgItem(IDC_RADIO3))->SetCheck(1); break; } 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(); AfxGetApp()->WriteProfileInt (LYFZVERSION, "appendname", m_check1); AfxGetApp()->WriteProfileInt (LYFZVERSION, "phototype", m_mode); CDialog::OnOK(); } //³õÐÞ void SelectPhotoDlg::OnRADIO1() { m_mode = 2; } //ԭƬ void SelectPhotoDlg::OnRADIO2() { m_mode = 1; } //³õÐÞ+ԭƬ void SelectPhotoDlg::OnRADIO3() { m_mode = 0; }