home *** CD-ROM | disk | FTP | other *** search
/ Programming Windows 95 with MFC / Programming Windows 95 with MFC (Microsoft Programming Series)(097-0001465)(1996).iso / CODE / Chap04 / Paint2 / Paint2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-05  |  1.4 KB  |  62 lines

  1. //***********************************************************************
  2. //
  3. //  Paint2.h
  4. //
  5. //***********************************************************************
  6.  
  7. class CLine : public CObject
  8. {
  9. private:
  10.     CPoint m_ptFrom;
  11.     CPoint m_ptTo;
  12.     UINT m_nWidth;
  13.     COLORREF m_crColor;
  14.  
  15. public:
  16.     CLine (CPoint, CPoint, UINT, COLORREF);
  17.     virtual void Draw (CDC*);
  18. };
  19.  
  20. class CMyApp : public CWinApp
  21. {
  22. public:
  23.     virtual BOOL InitInstance ();
  24. };
  25.  
  26. class CMainWindow : public CFrameWnd
  27. {
  28. private:
  29.     UINT m_nColor;
  30.     UINT m_nWidth;
  31.     CPoint m_ptFrom;
  32.     CPoint m_ptTo;
  33.     CObArray m_lineArray;
  34.  
  35.     static const COLORREF crColors[8];
  36.  
  37.     void InvertLine (CDC*, CPoint, CPoint);
  38.     void DeleteAllLines ();
  39.  
  40. public:
  41.     CMainWindow ();
  42.     ~CMainWindow ();
  43.  
  44. protected:
  45.     afx_msg void OnPaint ();
  46.     afx_msg void OnFileNew ();
  47.     afx_msg void OnUpdateFileNewUI (CCmdUI*);
  48.     afx_msg void OnFileExit ();
  49.     afx_msg void OnWidth (UINT);
  50.     afx_msg void OnUpdateWidthUI (CCmdUI*);
  51.     afx_msg void OnColor (UINT);
  52.     afx_msg void OnUpdateColorUI (CCmdUI*);
  53.     afx_msg void OnLButtonDown (UINT, CPoint);
  54.     afx_msg void OnMouseMove (UINT, CPoint);
  55.     afx_msg void OnLButtonUp (UINT, CPoint);
  56.     afx_msg void OnContextMenu (CWnd*, CPoint);
  57.     afx_msg void OnMeasureItem (int, LPMEASUREITEMSTRUCT);
  58.     afx_msg void OnDrawItem (int, LPDRAWITEMSTRUCT);
  59.     
  60.     DECLARE_MESSAGE_MAP ()
  61. };
  62.