home *** CD-ROM | disk | FTP | other *** search
/ Using Visual C++ 4 (Special Edition) / Using_Visual_C_4_Special_Edition_QUE_1996.iso / ch08 / ocontain / contai~2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-10  |  2.4 KB  |  77 lines

  1. // ContainView.h : interface of the CContainView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4.  
  5. class CContainCntrItem;
  6.  
  7. class CContainView : public CView
  8. {
  9. protected: // create from serialization only
  10.     CContainView();
  11.     DECLARE_DYNCREATE(CContainView)
  12.  
  13. // Attributes
  14. public:
  15.     CContainDoc* GetDocument();
  16.     // m_pSelection holds the selection to the current CContainCntrItem.
  17.     // For many applications, such a member variable isn't adequate to
  18.     //  represent a selection, such as a multiple selection or a selection
  19.     //  of objects that are not CContainCntrItem objects.  This selection
  20.     //  mechanism is provided just to help you get started.
  21.  
  22.     // TODO: replace this selection mechanism with one appropriate to your app.
  23.     CContainCntrItem* m_pSelection;
  24.  
  25. // Operations
  26. public:
  27.    void SetSelection(CContainCntrItem* pItem);
  28.    void SetupTracker(CContainCntrItem* pItem, CRectTracker* pTracker);
  29.    CContainCntrItem* HitTestItems(CPoint point);
  30.  
  31.    // Overrides
  32.     // ClassWizard generated virtual function overrides
  33.     //{{AFX_VIRTUAL(CContainView)
  34.     public:
  35.     virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  36.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  37.     protected:
  38.     virtual void OnInitialUpdate(); // called first time after construct
  39.     virtual BOOL IsSelected(const CObject* pDocItem) const;// Container support
  40.     //}}AFX_VIRTUAL
  41.  
  42. // Implementation
  43. public:
  44.     virtual ~CContainView();
  45. #ifdef _DEBUG
  46.     virtual void AssertValid() const;
  47.     virtual void Dump(CDumpContext& dc) const;
  48. #endif
  49.  
  50. protected:
  51.  
  52. // Generated message map functions
  53. protected:
  54.     //{{AFX_MSG(CContainView)
  55.     afx_msg void OnSetFocus(CWnd* pOldWnd);
  56.     afx_msg void OnSize(UINT nType, int cx, int cy);
  57.     afx_msg void OnInsertObject();
  58.     afx_msg void OnCancelEditCntr();
  59.     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  60.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  61.     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  62.     afx_msg void OnEditCopy();
  63.     afx_msg void OnEditClear();
  64.     afx_msg void OnUpdateEditClear(CCmdUI* pCmdUI);
  65.     afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
  66.     afx_msg void OnEditPaste();
  67.     //}}AFX_MSG
  68.     DECLARE_MESSAGE_MAP()
  69. };
  70.  
  71. #ifndef _DEBUG  // debug version in ContainView.cpp
  72. inline CContainDoc* CContainView::GetDocument()
  73.    { return (CContainDoc*)m_pDocument; }
  74. #endif
  75.  
  76. /////////////////////////////////////////////////////////////////////////////
  77.