SelectPhotoDlg.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // SelectPhotoDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "SelectPhotoDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // SelectPhotoDlg dialog
  13. SelectPhotoDlg::SelectPhotoDlg(CWnd* pParent /*=NULL*/)
  14. : CDialog(SelectPhotoDlg::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(SelectPhotoDlg)
  17. m_mode = 0;
  18. m_check1 = 0;
  19. //}}AFX_DATA_INIT
  20. }
  21. void SelectPhotoDlg::DoDataExchange(CDataExchange* pDX)
  22. {
  23. CDialog::DoDataExchange(pDX);
  24. //{{AFX_DATA_MAP(SelectPhotoDlg)
  25. DDX_Radio(pDX, IDC_RADIO1, m_mode);
  26. DDX_Check(pDX, IDC_CHECK1, m_check1);
  27. //}}AFX_DATA_MAP
  28. }
  29. BEGIN_MESSAGE_MAP(SelectPhotoDlg, CDialog)
  30. //{{AFX_MSG_MAP(SelectPhotoDlg)
  31. //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33. /////////////////////////////////////////////////////////////////////////////
  34. // SelectPhotoDlg message handlers
  35. void SelectPhotoDlg::OnOK()
  36. {
  37. // TODO: Add extra validation here
  38. UpdateData();
  39. CString version = _T ("Version 1.0");
  40. AfxGetApp()->WriteProfileInt (version, "appendname", m_check1);
  41. AfxGetApp()->WriteProfileInt (version, "phototype", m_mode);
  42. CDialog::OnOK();
  43. }
  44. BOOL SelectPhotoDlg::OnInitDialog()
  45. {
  46. CDialog::OnInitDialog();
  47. // TODO: Add extra initialization here
  48. CString version = _T ("Version 1.0");
  49. m_check1=AfxGetApp()->GetProfileInt (version, "appendname", 0);
  50. m_mode=AfxGetApp()->GetProfileInt (version, "phototype", 0);
  51. UpdateData(false);
  52. return TRUE; // return TRUE unless you set the focus to a control
  53. // EXCEPTION: OCX Property Pages should return FALSE
  54. }
  55. void SelectPhotoDlg::OnCancel()
  56. {
  57. // TODO: Add extra cleanup here
  58. UpdateData();
  59. CString version = _T ("Version 1.0");
  60. AfxGetApp()->WriteProfileInt (version, "appendname", m_check1);
  61. AfxGetApp()->WriteProfileInt (version, "phototype", m_mode);
  62. CDialog::OnOK();
  63. }