home *** CD-ROM | disk | FTP | other *** search
/ Mastering MFC Development / MMD.ISO / samples / c12 / useclock / hoursminutesdlg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  1.4 KB  |  62 lines

  1. // HoursMinutesDlg.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "UseClock.h"
  6. #include "HoursMinutesDlg.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CHoursMinutesDlg dialog
  16.  
  17.  
  18. CHoursMinutesDlg::CHoursMinutesDlg(short DisablingFlag, CWnd* pParent /*=NULL*/)
  19.     : CDialog(CHoursMinutesDlg::IDD, pParent)
  20. {
  21.     //{{AFX_DATA_INIT(CHoursMinutesDlg)
  22.     m_hours = 0;
  23.     m_minutes = 0;
  24.     //}}AFX_DATA_INIT
  25.     
  26.     m_DisablingFlag = DisablingFlag;
  27. }
  28.  
  29.  
  30. void CHoursMinutesDlg::DoDataExchange(CDataExchange* pDX)
  31. {
  32.     CDialog::DoDataExchange(pDX);
  33.     //{{AFX_DATA_MAP(CHoursMinutesDlg)
  34.     DDX_Text(pDX, IDC_HOURS, m_hours);
  35.     DDV_MinMaxInt(pDX, m_hours, 0, 23);
  36.     DDX_Text(pDX, IDC_MINUTES, m_minutes);
  37.     DDV_MinMaxInt(pDX, m_minutes, 0, 59);
  38.     //}}AFX_DATA_MAP
  39. }
  40.  
  41.  
  42. BEGIN_MESSAGE_MAP(CHoursMinutesDlg, CDialog)
  43.     //{{AFX_MSG_MAP(CHoursMinutesDlg)
  44.     //}}AFX_MSG_MAP
  45. END_MESSAGE_MAP()
  46.  
  47. /////////////////////////////////////////////////////////////////////////////
  48. // CHoursMinutesDlg message handlers
  49.  
  50. BOOL CHoursMinutesDlg::OnInitDialog() 
  51. {
  52.     CDialog::OnInitDialog();
  53.     
  54.     if (1 == m_DisablingFlag)
  55.         GetDlgItem(IDC_HOURS)->EnableWindow(FALSE);
  56.     
  57.     if (2 == m_DisablingFlag)
  58.         GetDlgItem(IDC_MINUTES)->EnableWindow(FALSE);
  59.     
  60.     return TRUE;
  61. }
  62.