home *** CD-ROM | disk | FTP | other *** search
/ 3D Graphics Programming for Windows 95 / 3D_Graphics_Programming_for_Windows_95_Microsoft_1996.iso / samples / blobs / indevdlg.cpp < prev    next >
C/C++ Source or Header  |  1996-02-11  |  2KB  |  119 lines

  1. // InDevDlg.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Stage.h"
  6. #include "InDevDlg.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. // CInpDevDlg dialog
  16.  
  17.  
  18. CInpDevDlg::CInpDevDlg(CWnd* pParent /*=NULL*/)
  19.     : CDialog(CInpDevDlg::IDD, pParent)
  20. {
  21.     //{{AFX_DATA_INIT(CInpDevDlg)
  22.         // NOTE: the ClassWizard will add member initialization here
  23.     //}}AFX_DATA_INIT
  24.     m_iDevice = 0;
  25.     m_iObject = 0;
  26.     m_iType = 0;
  27. }
  28.  
  29.  
  30. void CInpDevDlg::DoDataExchange(CDataExchange* pDX)
  31. {
  32.     CDialog::DoDataExchange(pDX);
  33.     //{{AFX_DATA_MAP(CInpDevDlg)
  34.         // NOTE: the ClassWizard will add DDX and DDV calls here
  35.     //}}AFX_DATA_MAP
  36. }
  37.  
  38.  
  39. BEGIN_MESSAGE_MAP(CInpDevDlg, CDialog)
  40.     //{{AFX_MSG_MAP(CInpDevDlg)
  41.     //}}AFX_MSG_MAP
  42. END_MESSAGE_MAP()
  43.  
  44. /////////////////////////////////////////////////////////////////////////////
  45. // CInpDevDlg message handlers
  46.  
  47. BOOL CInpDevDlg::OnInitDialog() 
  48. {
  49.     CDialog::OnInitDialog();
  50.     
  51.     switch (m_iObject) {
  52.     default:
  53.         m_iObject = 0;
  54.         // fall through
  55.     case 0:
  56.         CheckRadioButton(IDC_RADIO4, IDC_RADIO5, IDC_RADIO4);
  57.         break;
  58.     case 1:
  59.         CheckRadioButton(IDC_RADIO4, IDC_RADIO5, IDC_RADIO5);
  60.         break;
  61.     }
  62.  
  63.     switch (m_iType) {
  64.     default:
  65.         m_iType = 0;
  66.         // fall through
  67.     case 0:
  68.         CheckRadioButton(IDC_RADIO6, IDC_RADIO7, IDC_RADIO6);
  69.         break;
  70.     case 1:
  71.         CheckRadioButton(IDC_RADIO6, IDC_RADIO7, IDC_RADIO7);
  72.         break;
  73.     }
  74.  
  75.     switch (m_iDevice) {
  76.     default:
  77.         m_iDevice = 0;
  78.         // fall through
  79.     case 0:
  80.         CheckRadioButton(IDC_RADIO1, IDC_RADIO3, IDC_RADIO1);
  81.         break;
  82.     case 1:
  83.         CheckRadioButton(IDC_RADIO1, IDC_RADIO3, IDC_RADIO2);
  84.         break;
  85.     case 2:
  86.         CheckRadioButton(IDC_RADIO1, IDC_RADIO3, IDC_RADIO3);
  87.         break;
  88.     }
  89.  
  90.     
  91.     return TRUE;  // return TRUE unless you set the focus to a control
  92.                   // EXCEPTION: OCX Property Pages should return FALSE
  93. }
  94.  
  95. void CInpDevDlg::OnOK() 
  96. {
  97.     if (IsDlgButtonChecked(IDC_RADIO5)) {
  98.         m_iObject = 1;
  99.     } else {
  100.         m_iObject = 0;
  101.     }
  102.     
  103.     if (IsDlgButtonChecked(IDC_RADIO7)) {
  104.         m_iType = 1;
  105.     } else {
  106.         m_iType = 0;
  107.     }
  108.     
  109.     if (IsDlgButtonChecked(IDC_RADIO3)) {
  110.         m_iDevice = 2;
  111.     } else if (IsDlgButtonChecked(IDC_RADIO2)) {
  112.         m_iDevice = 1;
  113.     } else {
  114.         m_iDevice = 0;
  115.     }
  116.     
  117.     CDialog::OnOK();
  118. }
  119.