--- /dev/null
+//////////////////////////////////////////////////////\r
+// View.h\r
+// Declaration of the CView class\r
+\r
+#ifndef VIEW_H\r
+#define VIEW_H\r
+\r
+\r
+#include "wincore.h"\r
+#include <vector>\r
+\r
+using std::vector;\r
+\r
+\r
+class CView : public CWnd\r
+{\r
+public:\r
+ CView();\r
+ virtual ~CView();\r
+ virtual void ClearPoints();\r
+ virtual BOOL FileOpen(LPCTSTR szFilename);\r
+ virtual BOOL FileSave(LPCTSTR szFilename);\r
+ virtual void SetPen(COLORREF Color);\r
+\r
+protected:\r
+ virtual void OnDraw(CDC* pDC);\r
+ virtual void PreCreate(CREATESTRUCT &cs);\r
+ virtual void PreRegisterClass(WNDCLASS &wc);\r
+ virtual LRESULT WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam);\r
+\r
+private:\r
+ struct PlotPoint\r
+ {\r
+ int x;\r
+ int y;\r
+ bool PenDown;\r
+ COLORREF color;\r
+ };\r
+\r
+ void DrawLine(int x, int y);\r
+ void OnLButtonDown(LPARAM lParam);\r
+ void OnLButtonUp(LPARAM lParam);\r
+ void OnMouseMove(WPARAM wParam, LPARAM lParam);\r
+ void StorePoint(int x, int y, bool PenDown);\r
+\r
+ CBrush m_Brush;\r
+ vector<PlotPoint> m_points; // Points of lines to draw\r
+ COLORREF m_PenColor;\r
+};\r
+\r
+\r
+#endif // CVIEW_H\r