GeneralPrefsDlg.cpp
上传用户:qifu0001
上传日期:2007-01-02
资源大小:52k
文件大小:2k
源码类别:

TreeView控件

开发平台:

Visual C++

  1. // GeneralPrefsDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "TPS_Demo.h"
  5. #include "GeneralPrefsDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CGeneralPrefsDlg dialog
  13. CGeneralPrefsDlg::CGeneralPrefsDlg()
  14. : CPropertyPage(CGeneralPrefsDlg::IDD)
  15. {
  16. //{{AFX_DATA_INIT(CGeneralPrefsDlg)
  17. m_bISee = ((CTPS_DemoApp*)AfxGetApp())->gprf_bISee;
  18. m_bDontLike = ((CTPS_DemoApp*)AfxGetApp())->gprf_bDontLike;
  19. m_bLikeBeer = ((CTPS_DemoApp*)AfxGetApp())->gprf_bLikeBeer;
  20. m_nWhen = ((CTPS_DemoApp*)AfxGetApp())->gprf_nWhen;
  21. //}}AFX_DATA_INIT
  22. }
  23. void CGeneralPrefsDlg::DoDataExchange(CDataExchange* pDX)
  24. {
  25. CDialog::DoDataExchange(pDX);
  26. //{{AFX_DATA_MAP(CGeneralPrefsDlg)
  27. DDX_Check(pDX, IDC_CHECK1, m_bISee);
  28. DDX_Check(pDX, IDC_CHECK2, m_bDontLike);
  29. DDX_Check(pDX, IDC_CHECK3, m_bLikeBeer);
  30. DDX_CBIndex(pDX, IDC_COMBO1, m_nWhen);
  31. //}}AFX_DATA_MAP
  32. }
  33. BEGIN_MESSAGE_MAP(CGeneralPrefsDlg, CPropertyPage)
  34. //{{AFX_MSG_MAP(CGeneralPrefsDlg)
  35. ON_BN_CLICKED(IDOK, OnOk)
  36. //}}AFX_MSG_MAP
  37. END_MESSAGE_MAP()
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CGeneralPrefsDlg message handlers
  40. BOOL CGeneralPrefsDlg::OnInitDialog() 
  41. {
  42. CDialog::OnInitDialog();
  43. // TODO: Add extra initialization here
  44. return TRUE;  // return TRUE unless you set the focus to a control
  45.               // EXCEPTION: OCX Property Pages should return FALSE
  46. }
  47. void CGeneralPrefsDlg::OnOk() 
  48. {
  49. // TODO: Add your control notification handler code here
  50. UpdateData();
  51. ((CTPS_DemoApp*)AfxGetApp())->gprf_bISee = m_bISee;
  52. ((CTPS_DemoApp*)AfxGetApp())->gprf_bDontLike = m_bDontLike;
  53. ((CTPS_DemoApp*)AfxGetApp())->gprf_bLikeBeer = m_bLikeBeer;
  54. ((CTPS_DemoApp*)AfxGetApp())->gprf_nWhen = m_nWhen;
  55. }