Commit before breaking everything
[matches/honours.git] / research / transmission_spectroscopy / TOF / Win32++ / samples / Frame / src / View.cpp
diff --git a/research/transmission_spectroscopy/TOF/Win32++/samples/Frame/src/View.cpp b/research/transmission_spectroscopy/TOF/Win32++/samples/Frame/src/View.cpp
new file mode 100644 (file)
index 0000000..b0d6036
--- /dev/null
@@ -0,0 +1,70 @@
+//////////////////////////////////////////////\r
+// View.cpp\r
+//  Definitions for the CView class\r
+\r
+#include "stdafx.h"\r
+#include "view.h"\r
+\r
+\r
+CView::CView()\r
+{\r
+}\r
+\r
+void CView::OnDraw(CDC* pDC)\r
+{\r
+       CRect rc = GetClientRect();\r
+\r
+       // Centre some text in our view window\r
+       pDC->DrawText(_T("View Window"), -1, rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);\r
+}\r
+\r
+void CView::OnInitialUpdate()\r
+{\r
+       // OnInitialUpdate is called immediately after the window is created\r
+       TRACE(_T("View window created\n"));\r
+}\r
+\r
+void CView::PreCreate(CREATESTRUCT &cs)\r
+{\r
+       // Here we set the defaults used by the create function for the view window\r
+       // Preforming this is optional, but doing so allows us to\r
+       // take more precise control over the window we create.\r
+\r
+       // Set the extended style\r
+       cs.dwExStyle = WS_EX_CLIENTEDGE;\r
+}\r
+\r
+void CView::PreRegisterClass(WNDCLASS &wc)\r
+{\r
+       // Here we set the Window class parameters.\r
+       // Preforming this is optional, but doing so allows us to\r
+       // take more precise control over the type of window we create.\r
+\r
+       // Set the Window Class name\r
+       wc.lpszClassName = _T("View");\r
+\r
+       // Set a background brush to white\r
+       wc.hbrBackground = (HBRUSH)::GetStockObject(WHITE_BRUSH);\r
+\r
+       // Set the default cursor\r
+       wc.hCursor = ::LoadCursor(NULL, IDC_ARROW);\r
+\r
+       // Set the class style (not to be confused with the window styles set in PreCreate)\r
+       wc.style = CS_DBLCLKS;  // Generate left button double click messages\r
+}\r
+\r
+LRESULT CView::WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam)\r
+{\r
+       switch (uMsg)\r
+       {\r
+       case WM_SIZE:\r
+               Invalidate();\r
+               break;  // Also do default processing\r
+       }\r
+\r
+       // pass unhandled messages on for default processing\r
+       return WndProcDefault(uMsg, wParam, lParam);\r
+}\r
+\r
+\r
+\r

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