StaffAchievementSet.cpp 1.9 KB

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