home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / beaversweeper_v101.zip / src / PropPageEditor.cpp < prev    next >
C/C++ Source or Header  |  2003-01-06  |  3KB  |  103 lines

  1. // PropPageEditor.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "tracker.h"
  6. #include "PropPageEditor.h"
  7. #include "Configuration.h"
  8. #include "Globals.h"
  9.  
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CPropPageEditor property page
  18.  
  19. IMPLEMENT_DYNCREATE(CPropPageEditor, CPropertyPage)
  20.  
  21. CPropPageEditor::CPropPageEditor() : CPropertyPage(CPropPageEditor::IDD)
  22. {
  23.     //{{AFX_DATA_INIT(CPropPageEditor)
  24.     m_patposadd = 0;
  25.     m_chanposadd = 0;
  26.     //}}AFX_DATA_INIT
  27. }
  28.  
  29. CPropPageEditor::~CPropPageEditor()
  30. {
  31. }
  32.  
  33. void CPropPageEditor::DoDataExchange(CDataExchange* pDX)
  34. {
  35.     CPropertyPage::DoDataExchange(pDX);
  36.     //{{AFX_DATA_MAP(CPropPageEditor)
  37.     DDX_Text(pDX, IDC_EDIT1, m_patposadd);
  38.     DDV_MinMaxInt(pDX, m_patposadd, 0, 256);
  39.     DDX_Text(pDX, IDC_EDIT2, m_chanposadd);
  40.     DDV_MinMaxInt(pDX, m_chanposadd, 0, 256);
  41.     //}}AFX_DATA_MAP
  42. }
  43.  
  44.  
  45. BEGIN_MESSAGE_MAP(CPropPageEditor, CPropertyPage)
  46.     //{{AFX_MSG_MAP(CPropPageEditor)
  47.     ON_EN_CHANGE(IDC_EDIT2, OnChangeEdit2)
  48.     ON_EN_CHANGE(IDC_EDIT1, OnChangeEdit1)
  49.     //}}AFX_MSG_MAP
  50. END_MESSAGE_MAP()
  51.  
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CPropPageEditor message handlers
  54.  
  55. BOOL CPropPageEditor::OnInitDialog() 
  56. {
  57.     CPropertyPage::OnInitDialog();
  58.     // TODO: Add extra initialization here
  59.  
  60.     m_patposadd = g_patposadd;
  61.     m_chanposadd = g_chanposadd;
  62.     UpdateData(FALSE);
  63.  
  64.     
  65.     return TRUE;  // return TRUE unless you set the focus to a control
  66.                   // EXCEPTION: OCX Property Pages should return FALSE
  67. }
  68.  
  69. void CPropPageEditor::OnChangeEdit2() 
  70. {
  71.     // TODO: If this is a RICHEDIT control, the control will not
  72.     // send this notification unless you override the CPropertyPage::OnInitDialog()
  73.     // function and call CRichEditCtrl().SetEventMask()
  74.     // with the ENM_CHANGE flag ORed into the mask.    
  75.     // TODO: Add your control notification handler code here    
  76.     SetModified(TRUE);
  77.     
  78. }
  79.  
  80. void CPropPageEditor::OnChangeEdit1() 
  81. {
  82.     // TODO: If this is a RICHEDIT control, the control will not
  83.     // send this notification unless you override the CPropertyPage::OnInitDialog()
  84.     // function and call CRichEditCtrl().SetEventMask()
  85.     // with the ENM_CHANGE flag ORed into the mask.    
  86.     // TODO: Add your control notification handler code here
  87.     SetModified(TRUE);
  88.     
  89. }
  90.  
  91. BOOL CPropPageEditor::OnApply() 
  92. {
  93.     UpdateData(TRUE);
  94.     // TODO: Add your specialized code here and/or call the base class
  95.     g_patposadd = m_patposadd;
  96.     g_chanposadd = m_chanposadd;
  97.     
  98.     CONFIGURATION_SETDWORD( _T("Editor"), _T("PatPosAdd"), g_patposadd );
  99.     CONFIGURATION_SETDWORD( _T("Editor"), _T("ChanPosAdd"), g_chanposadd );    
  100.     
  101.     return CPropertyPage::OnApply();
  102. }
  103.