StaffAchievementSet.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. m_bautoshutdown=AfxGetApp()->GetProfileInt (LYFZVERSION, "autoshutdown", 1);
  45. m_time=AfxGetApp()->GetProfileInt(LYFZVERSION, "shutdowntime", 20);
  46. //version.Format("%d",m_time);
  47. //AfxMessageBox(version);
  48. UpdateData(false);
  49. return TRUE; // return TRUE unless you set the focus to a control
  50. // EXCEPTION: OCX Property Pages should return FALSE
  51. }
  52. void StaffAchievementSet::OnOK()
  53. {
  54. // TODO: Add extra validation here
  55. UpdateData();
  56. AfxGetApp()->WriteProfileInt (LYFZVERSION, "autoshutdown", m_bautoshutdown);
  57. AfxGetApp()->WriteProfileInt (LYFZVERSION, "shutdowntime", m_time);
  58. CDialog::OnOK();
  59. }