home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / leadtools / ocx32.lt / UNDERLAY.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-10  |  2.0 KB  |  84 lines

  1. // underlay.cpp : implementation file
  2. // Copyright (C) 1996 LEAD Technologies, Inc.
  3. // All rights reserved.
  4.  
  5. #include "stdafx.h"
  6. #include "mfcdemo.h"
  7. #include "underlay.h"
  8.  
  9. #ifdef _DEBUG
  10. #undef THIS_FILE
  11. static char BASED_CODE THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. extern CMfcdemoApp theApp;
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CUnderLayDlg dialog
  18.  
  19.  
  20. CUnderLayDlg::CUnderLayDlg(CWnd* pParent /*=NULL*/)
  21.     : CDialog(CUnderLayDlg::IDD, pParent)
  22. {
  23.     //{{AFX_DATA_INIT(CUnderLayDlg)
  24.         // NOTE: the ClassWizard will add member initialization here
  25.         m_pDocument = NULL;
  26.         m_fTile = TRUE;
  27.         m_pDocArray = NULL;
  28.     //}}AFX_DATA_INIT
  29. }
  30.  
  31.  
  32. void CUnderLayDlg::DoDataExchange(CDataExchange* pDX)
  33. {
  34.     CDialog::DoDataExchange(pDX);
  35.     //{{AFX_DATA_MAP(CUnderLayDlg)
  36.     DDX_Control(pDX, IDC_COMBO1, m_Combo1);
  37.     //}}AFX_DATA_MAP
  38. }
  39.  
  40.  
  41. BEGIN_MESSAGE_MAP(CUnderLayDlg, CDialog)
  42.     //{{AFX_MSG_MAP(CUnderLayDlg)
  43.     ON_WM_DESTROY()
  44.     //}}AFX_MSG_MAP
  45. END_MESSAGE_MAP()
  46.  
  47.  
  48. /////////////////////////////////////////////////////////////////////////////
  49. // CUnderLayDlg message handlers
  50.  
  51. BOOL CUnderLayDlg::OnInitDialog() 
  52. {
  53.     CDialog::OnInitDialog();
  54.     
  55.         m_pDocArray = theApp.EnumAllDocuments();
  56.         for(int i = 0; i < m_pDocArray->GetSize(); i++)
  57.         {
  58.                 m_Combo1.AddString(((CDocument*) m_pDocArray->GetAt(i))->GetTitle());
  59.         }
  60.         m_Combo1.SetCurSel(0);
  61.         CheckDlgButton (IDC_RADIO1, TRUE);
  62.  
  63.     return TRUE;  // return TRUE unless you set the focus to a control
  64.                   // EXCEPTION: OCX Property Pages should return FALSE
  65. }
  66.  
  67. void CUnderLayDlg::OnOK() 
  68. {
  69.         m_pDocument = (CDocument*) m_pDocArray->GetAt(m_Combo1.GetCurSel());
  70.         m_fTile = IsDlgButtonChecked(IDC_RADIO1);    
  71.     CDialog::OnOK();
  72. }
  73.  
  74. void CUnderLayDlg::OnDestroy() 
  75. {
  76.     CDialog::OnDestroy();
  77.  
  78.         if(m_pDocArray)
  79.         {
  80.                 delete m_pDocArray;
  81.                 m_pDocArray = NULL;
  82.         }
  83. }
  84.