home *** CD-ROM | disk | FTP | other *** search
- // underlay.cpp : implementation file
- // Copyright (C) 1996 LEAD Technologies, Inc.
- // All rights reserved.
-
- #include "stdafx.h"
- #include "mfcdemo.h"
- #include "underlay.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- extern CMfcdemoApp theApp;
-
- /////////////////////////////////////////////////////////////////////////////
- // CUnderLayDlg dialog
-
-
- CUnderLayDlg::CUnderLayDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CUnderLayDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CUnderLayDlg)
- // NOTE: the ClassWizard will add member initialization here
- m_pDocument = NULL;
- m_fTile = TRUE;
- m_pDocArray = NULL;
- //}}AFX_DATA_INIT
- }
-
-
- void CUnderLayDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CUnderLayDlg)
- DDX_Control(pDX, IDC_COMBO1, m_Combo1);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CUnderLayDlg, CDialog)
- //{{AFX_MSG_MAP(CUnderLayDlg)
- ON_WM_DESTROY()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CUnderLayDlg message handlers
-
- BOOL CUnderLayDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- m_pDocArray = theApp.EnumAllDocuments();
- for(int i = 0; i < m_pDocArray->GetSize(); i++)
- {
- m_Combo1.AddString(((CDocument*) m_pDocArray->GetAt(i))->GetTitle());
- }
- m_Combo1.SetCurSel(0);
- CheckDlgButton (IDC_RADIO1, TRUE);
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
-
- void CUnderLayDlg::OnOK()
- {
- m_pDocument = (CDocument*) m_pDocArray->GetAt(m_Combo1.GetCurSel());
- m_fTile = IsDlgButtonChecked(IDC_RADIO1);
- CDialog::OnOK();
- }
-
- void CUnderLayDlg::OnDestroy()
- {
- CDialog::OnDestroy();
-
- if(m_pDocArray)
- {
- delete m_pDocArray;
- m_pDocArray = NULL;
- }
- }