home *** CD-ROM | disk | FTP | other *** search
/ Master Visual C++ 1.5 / MASTERVC15.ISO / vcprog / original / ch11 / myradio / mydlg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-22  |  1.7 KB  |  79 lines

  1. // mydlg.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "myradio.h"
  6. #include "mydlg.h"
  7.  
  8. #ifdef _DEBUG
  9. #undef THIS_FILE
  10. static char BASED_CODE THIS_FILE[] = __FILE__;
  11. #endif
  12.  
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CMyDlg dialog
  15.  
  16.  
  17. CMyDlg::CMyDlg(CWnd* pParent /*=NULL*/)
  18.     : CDialog(CMyDlg::IDD, pParent)
  19. {
  20.     //{{AFX_DATA_INIT(CMyDlg)
  21.     
  22.      //////////////////////
  23.      // MY CODE STARTS HERE
  24.      //////////////////////
  25.  
  26.      m_BeepStatus  = 2; // Third radio button
  27.      m_VoiceStatus = 1; // Second radio button
  28.  
  29.  
  30.      ////////////////////
  31.      // MY CODE ENDS HERE
  32.      ////////////////////
  33.  
  34.      //}}AFX_DATA_INIT
  35.  
  36. }
  37.  
  38. void CMyDlg::DoDataExchange(CDataExchange* pDX)
  39. {
  40.     CDialog::DoDataExchange(pDX);
  41.     //{{AFX_DATA_MAP(CMyDlg)
  42.     DDX_Radio(pDX, IDC_RADIO_BEEP1, m_BeepStatus);
  43.     DDX_Radio(pDX, IDC_RADIO_HELLO, m_VoiceStatus);
  44.     //}}AFX_DATA_MAP
  45. }
  46.  
  47. BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
  48.     //{{AFX_MSG_MAP(CMyDlg)
  49.     ON_BN_CLICKED(IDC_DEFAULT, OnDefault)
  50.     //}}AFX_MSG_MAP
  51. END_MESSAGE_MAP()
  52.  
  53.  
  54. /////////////////////////////////////////////////////////////////////////////
  55. // CMyDlg message handlers
  56.  
  57. void CMyDlg::OnDefault()
  58. {
  59.     // TODO: Add your control notification handler code here
  60.  
  61.  
  62.      //////////////////////
  63.      // MY CODE STARTS HERE
  64.      //////////////////////
  65.  
  66.  
  67.     // Set the default values for the variables of
  68.     // the radio buttons.
  69.      m_BeepStatus  = 2; // Third radio button
  70.      m_VoiceStatus = 1; // Second radio button
  71.  
  72.     // Update the screen with the values of the variables.
  73.     UpdateData (FALSE );
  74.  
  75.      ////////////////////
  76.      // MY CODE ENDS HERE
  77.      ////////////////////
  78. }
  79.