Commit before breaking everything
[matches/honours.git] / research / transmission_spectroscopy / TOF / Win32++ / tutorials / Tutorial9 / View.h
1 //////////////////////////////////////////////////////\r
2 // View.h\r
3 //  Declaration of the CView class\r
4 \r
5 #ifndef VIEW_H\r
6 #define VIEW_H\r
7 \r
8 \r
9 #include "wincore.h"\r
10 #include <vector>\r
11 \r
12 using std::vector;\r
13 \r
14 \r
15 class CView : public CWnd\r
16 {\r
17 public:\r
18         CView();\r
19         virtual ~CView();\r
20         virtual void ClearPoints();\r
21         virtual BOOL FileOpen(LPCTSTR szFilename);\r
22         virtual BOOL FileSave(LPCTSTR szFilename);\r
23         virtual void SetPen(COLORREF Color);\r
24 \r
25 protected:\r
26         virtual void OnDraw(CDC* pDC);\r
27         virtual void PreCreate(CREATESTRUCT &cs);\r
28         virtual void PreRegisterClass(WNDCLASS &wc);\r
29         virtual LRESULT WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam);\r
30 \r
31 private:\r
32         struct PlotPoint\r
33         {\r
34                 int x;\r
35                 int y;\r
36                 bool PenDown;\r
37                 COLORREF color;\r
38         };\r
39 \r
40         void DrawLine(int x, int y);\r
41         void OnLButtonDown(LPARAM lParam);\r
42         void OnLButtonUp(LPARAM lParam);\r
43         void OnMouseMove(WPARAM wParam, LPARAM lParam);\r
44         void StorePoint(int x, int y, bool PenDown);\r
45 \r
46         CBrush m_Brush;\r
47         vector<PlotPoint> m_points;     // Points of lines to draw\r
48         COLORREF m_PenColor;\r
49 };\r
50 \r
51 \r
52 #endif // CVIEW_H\r

UCC git Repository :: git.ucc.asn.au