home *** CD-ROM | disk | FTP | other *** search
/ Mastering MFC Development / MMD.ISO / labs / c10 / lab01 / ex02 / childfrm.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  1.6 KB  |  79 lines

  1. // ChildFrm.cpp : implementation of the CChildFrame class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Browser.h"
  6.  
  7. #include "ChildFrm.h"
  8. #include "MainFrm.h"
  9. #include "DataView.h"
  10. #include "BrowserView.h"
  11.  
  12. #ifdef _DEBUG
  13. #define new DEBUG_NEW
  14. #undef THIS_FILE
  15. static char THIS_FILE[] = __FILE__;
  16. #endif
  17.  
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CChildFrame
  20.  
  21. IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
  22.  
  23. BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
  24.     //{{AFX_MSG_MAP(CChildFrame)
  25.     //}}AFX_MSG_MAP
  26. END_MESSAGE_MAP()
  27.  
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CChildFrame construction/destruction
  30.  
  31. CChildFrame::CChildFrame()
  32. {
  33.     // TODO: add member initialization code here
  34.     
  35. }
  36.  
  37. CChildFrame::~CChildFrame()
  38. {
  39. }
  40.  
  41. BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
  42. {
  43.     // TODO: Modify the Window class or styles here by modifying
  44.     //  the CREATESTRUCT cs
  45.  
  46.     return CMDIChildWnd::PreCreateWindow(cs);
  47. }
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CChildFrame diagnostics
  51.  
  52. #ifdef _DEBUG
  53. void CChildFrame::AssertValid() const
  54. {
  55.     CMDIChildWnd::AssertValid();
  56. }
  57.  
  58. void CChildFrame::Dump(CDumpContext& dc) const
  59. {
  60.     CMDIChildWnd::Dump(dc);
  61. }
  62.  
  63. #endif //_DEBUG
  64.  
  65. /////////////////////////////////////////////////////////////////////////////
  66. // CChildFrame message handlers
  67.  
  68.  
  69.  
  70. void CChildFrame::OnUpdateFrameTitle(  BOOL bAddToTitle )
  71. {
  72.     GetMDIFrame()->OnUpdateFrameTitle(bAddToTitle);
  73.  
  74.     CDocument* pDocument = GetActiveDocument();
  75.     
  76.     if (bAddToTitle && pDocument != NULL)
  77.         SetWindowText( ( LPCTSTR ) m_strCaption );
  78. }
  79.