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

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