home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / atl / atltangram / mfctangram / mainfrm.h < prev    next >
C/C++ Source or Header  |  1998-03-26  |  3KB  |  109 lines

  1. // MainFrm.h : interface of the CMFCMainFrame class
  2. //
  3. // This is a part of the Active Template Library.
  4. // Copyright (C) 1996-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Active Template Library Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Active Template Library product.
  12.  
  13. #if !defined(AFX_MAINFRM_H__D1CF42D5_B039_11D0_B69F_00A0C903487A__INCLUDED_)
  14. #define AFX_MAINFRM_H__D1CF42D5_B039_11D0_B69F_00A0C903487A__INCLUDED_
  15.  
  16. #if _MSC_VER >= 1000
  17. #pragma once
  18. #endif // _MSC_VER >= 1000
  19.  
  20. ///////////////////////////////////////////////////////////
  21. //
  22. // Includes and forward references.1
  23. //
  24. #include "tantype.h"
  25. #include <afxtempl.h>
  26.  
  27. interface IATLTangramModel ;
  28. interface IAtlTangramVisual ;
  29. interface IAtlTangramWorld ;
  30.  
  31. class CMFCMainFrame : public CFrameWnd
  32. {
  33. public:
  34.     CMFCMainFrame();
  35.  
  36. // Attributes
  37. public:
  38.     static CString s_strClassName ;
  39.  
  40.     // Interface pointer to World.
  41.     IAtlTangramWorld* m_pWorld ;
  42.  
  43.     // Model List
  44.     typedef CTypedPtrList< CPtrList, IATLTangramModel* > CModelList ;
  45.     CModelList m_ModelList ;
  46.  
  47.     // Selection
  48.     IAtlTangramVisual* m_pSelectedVisual ;
  49.     TangramSize2d m_sizedDiff;
  50.  
  51. // Helper functions
  52. public:
  53.     // Used to register window class and create window.
  54.     BOOL Create() ;
  55.  
  56.     // Initializes the components.
  57.     BOOL Initialize(int cx, int cy);
  58.  
  59.     // Function for handling mouse button down messages.
  60.     void DoButtonDown(UINT nWhichButton, CPoint point) ;
  61.  
  62. // Operations
  63. public:
  64.  
  65. // Overrides
  66.     // ClassWizard generated virtual function overrides
  67.     //{{AFX_VIRTUAL(CMFCMainFrame)
  68.     public:
  69.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  70.     protected:
  71.     virtual void PostNcDestroy();
  72.     //}}AFX_VIRTUAL
  73.  
  74. // Implementation
  75. public:
  76.     virtual ~CMFCMainFrame();
  77. #ifdef _DEBUG
  78.     virtual void AssertValid() const;
  79.     virtual void Dump(CDumpContext& dc) const;
  80. #endif
  81.  
  82. protected:  // control bar embedded members
  83.     CStatusBar  m_wndStatusBar;
  84.     CToolBar    m_wndToolBar;
  85.  
  86. // Generated message map functions
  87. protected:
  88.     //{{AFX_MSG(CMFCMainFrame)
  89.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  90.     afx_msg void OnPaint();
  91.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  92.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  93.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  94.     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  95.     afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
  96.     afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
  97.     afx_msg BOOL OnQueryNewPalette();
  98.     afx_msg void OnDestroy();
  99.     //}}AFX_MSG
  100.     DECLARE_MESSAGE_MAP()
  101. };
  102.  
  103. /////////////////////////////////////////////////////////////////////////////
  104.  
  105. //{{AFX_INSERT_LOCATION}}
  106. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  107.  
  108. #endif // !defined(AFX_MAINFRM_H__D1CF42D5_B039_11D0_B69F_00A0C903487A__INCLUDED_)
  109.