home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / MFC / SAMPLES / OCLIENT / MAINVIEW.H_ / MAINVIEW.H
Encoding:
C/C++ Source or Header  |  1993-02-08  |  2.7 KB  |  91 lines

  1. // mainview.h : interface of the CMainView class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992 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 Microsoft
  9. // QuickHelp and/or WinHelp documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13.  
  14.  
  15. class CRectItem;
  16.  
  17. class CMainView : public CView
  18. {
  19. protected: // create from serialization only
  20.     CMainView();
  21.     DECLARE_DYNCREATE(CMainView)
  22.  
  23. // Attributes
  24. public:
  25.     CMainDoc* GetDocument()
  26.         {
  27.             ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMainDoc)));
  28.             return (CMainDoc*) m_pDocument;
  29.         }
  30.  
  31.     CRectItem* GetSelection() const
  32.         { return m_pSelection; } // Just the top-most window
  33.     void SetSelection(CRectItem* pNewSel); // supports single selection
  34.  
  35. // Operations
  36. public:
  37.  
  38. // Implementation
  39. protected:
  40.     CRectItem* m_pSelection;
  41.     // Tracking state (global with capture)
  42.     static CRectItem* NEAR pItemTracking;   // NULL => no tracking
  43.     static CRect NEAR rectTrackOrigin;
  44.     static BOOL NEAR bTrackSizing;          // TRUE => resizing, FALSE => moving
  45.     static CPoint NEAR ptTrackOrigin;
  46.  
  47.     CRectItem* GetHitItem(CPoint point);
  48.  
  49. public:
  50.     virtual ~CMainView();
  51.     virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
  52.     virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  53.     virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
  54. #ifdef _DEBUG
  55.     virtual void AssertValid() const;
  56.     virtual void Dump(CDumpContext& dc) const;
  57. #endif
  58.  
  59.     // Printing support
  60. protected:
  61.     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  62.  
  63.     // OLE Client support
  64.     virtual BOOL IsSelected(const CObject* pDocItem) const;
  65.     BOOL DoCopySelection();
  66.     CRectItem* DoPasteItem(BOOL bLink);
  67.  
  68. // Generated message map functions
  69. protected:
  70.     //{{AFX_MSG(CMainView)
  71.     afx_msg void OnPaste();
  72.     afx_msg void OnPasteLink();
  73.     afx_msg void OnInsertObject();
  74.     afx_msg void OnUpdateEditMenu(CCmdUI* pCmdUI);
  75.     afx_msg void OnEditClear();
  76.     afx_msg void OnEditCopy();
  77.     afx_msg void OnEditCut();
  78.     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  79.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  80.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  81.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  82.     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  83.     afx_msg void OnUpdateTrackSize(CCmdUI* pCmdUI);
  84.     afx_msg void OnToggleTrackSize();
  85.     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  86.     //}}AFX_MSG
  87.     DECLARE_MESSAGE_MAP()
  88. };
  89.  
  90. /////////////////////////////////////////////////////////////////////////////
  91.