X-Git-Url: https://git.ucc.asn.au/?p=matches%2Fhonours.git;a=blobdiff_plain;f=research%2Ftransmission_spectroscopy%2FTOF%2FWin32%2B%2B%2Ftutorials%2FTutorial8%2FView.h;fp=research%2Ftransmission_spectroscopy%2FTOF%2FWin32%2B%2B%2Ftutorials%2FTutorial8%2FView.h;h=6faa50d5d050038ce730983e797401db5ac51ddd;hp=0000000000000000000000000000000000000000;hb=70a96cca12cb006506461d26cd112bab179fe74c;hpb=8caf60af39689a3546074f0c68d14c3a2e28191e diff --git a/research/transmission_spectroscopy/TOF/Win32++/tutorials/Tutorial8/View.h b/research/transmission_spectroscopy/TOF/Win32++/tutorials/Tutorial8/View.h new file mode 100644 index 00000000..6faa50d5 --- /dev/null +++ b/research/transmission_spectroscopy/TOF/Win32++/tutorials/Tutorial8/View.h @@ -0,0 +1,51 @@ +////////////////////////////////////////////////////// +// View.h +// Declaration of the CView class + +#ifndef VIEW_H +#define VIEW_H + +#include "wincore.h" +#include + +using std::vector; + + +class CView : public CWnd +{ +public: + CView(); + virtual ~CView(); + virtual void ClearPoints(); + virtual BOOL FileOpen(LPCTSTR szFilename); + virtual BOOL FileSave(LPCTSTR szFilename); + virtual void SetPen(COLORREF Color); + +protected: + virtual void OnDraw(CDC* pDC); + virtual void PreCreate(CREATESTRUCT &cs); + virtual void PreRegisterClass(WNDCLASS &wc); + virtual LRESULT WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam); + +private: + struct PlotPoint + { + int x; + int y; + bool PenDown; + COLORREF color; + }; + + void DrawLine(int x, int y); + void OnLButtonDown(LPARAM lParam); + void OnLButtonUp(LPARAM lParam); + void OnMouseMove(WPARAM wParam, LPARAM lParam); + void StorePoint(int x, int y, bool PenDown); + + CBrush m_Brush; + vector m_points; // Points of lines to draw + COLORREF m_PenColor; +}; + + +#endif // CVIEW_H