home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / ole / wordpad / filenewd.cpp < prev    next >
C/C++ Source or Header  |  1998-03-26  |  2KB  |  82 lines

  1. // filenewd.cpp : implementation file
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "wordpad.h"
  15. #include "filenewd.h"
  16. #include "helpids.h"
  17.  
  18. #ifdef _DEBUG
  19. #undef THIS_FILE
  20. static char BASED_CODE THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23. DWORD const CFileNewDialog::m_nHelpIDs[] =
  24. {
  25.     IDC_DATEDIALOG_LIST, IDH_WORDPAD_FILENEW_DOC,
  26.     0, 0
  27. };
  28.  
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CFileNewDialog dialog
  31.  
  32. CFileNewDialog::CFileNewDialog(CWnd* pParent /*=NULL*/)
  33.     : CCSDialog(CFileNewDialog::IDD, pParent)
  34. {
  35.     //{{AFX_DATA_INIT(CFileNewDialog)
  36.     m_nSel = -1;
  37.     //}}AFX_DATA_INIT
  38. }
  39.  
  40.  
  41. void CFileNewDialog::DoDataExchange(CDataExchange* pDX)
  42. {
  43.     CCSDialog::DoDataExchange(pDX);
  44.     //{{AFX_DATA_MAP(CFileNewDialog)
  45.     DDX_Control(pDX, IDC_DATEDIALOG_LIST, m_listbox);
  46.     DDX_LBIndex(pDX, IDC_DATEDIALOG_LIST, m_nSel);
  47.     //}}AFX_DATA_MAP
  48. }
  49.  
  50.  
  51. BEGIN_MESSAGE_MAP(CFileNewDialog, CCSDialog)
  52.     //{{AFX_MSG_MAP(CFileNewDialog)
  53.     ON_LBN_DBLCLK(IDC_DATEDIALOG_LIST, OnDblclkDatedialogList)
  54.     //}}AFX_MSG_MAP
  55. END_MESSAGE_MAP()
  56.  
  57.  
  58. /////////////////////////////////////////////////////////////////////////////
  59. // CFileNewDialog message handlers
  60.  
  61. BOOL CFileNewDialog::OnInitDialog()
  62. {
  63.     CCSDialog::OnInitDialog();
  64.  
  65.     CString str;
  66.     VERIFY(str.LoadString(IDS_WORD6_DOCUMENT));
  67.     m_listbox.AddString(str);
  68.     VERIFY(str.LoadString(IDS_RTF_DOCUMENT));
  69.     m_listbox.AddString(str);
  70.     VERIFY(str.LoadString(IDS_TEXT_DOCUMENT));
  71.     m_listbox.AddString(str);
  72.     m_listbox.SetCurSel(0);
  73.  
  74.     return TRUE;  // return TRUE unless you set the focus to a control
  75.                   // EXCEPTION: OCX Property Pages should return FALSE
  76. }
  77.  
  78. void CFileNewDialog::OnDblclkDatedialogList()
  79. {
  80.     OnOK();
  81. }
  82.