19d9074420e52ee25681643d5d9ca7d4b54cb3f2
[matches/honours.git] / research / transmission_spectroscopy / TOF / Win32++ / samples / PropertySheet / src / View.cpp
1 //////////////////////////////////////////////\r
2 // View.cpp\r
3 //  Definitions for the CView class\r
4 \r
5 #include "stdafx.h"\r
6 #include "view.h"\r
7 \r
8 \r
9 CView::CView()\r
10 {\r
11 }\r
12 \r
13 void CView::OnDraw(CDC* pDC)\r
14 {\r
15         CRect rc = GetClientRect();\r
16 \r
17         // Centre some text in our view window\r
18         pDC->DrawText(_T("Choose a Property Sheet from the menu"), -1, rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);\r
19 }\r
20 \r
21 void CView::OnInitialUpdate()\r
22 {\r
23         // OnInitialUpdate is called immediately after the window is created\r
24         TRACE(_T("View Window Created\n"));\r
25 }\r
26 \r
27 void CView::PreCreate(CREATESTRUCT &cs)\r
28 {\r
29         // Here we set the defaults used by the create function for the view window\r
30         // Preforming this is optional, but doing so allows us to\r
31         // take more precise control over the window we create.\r
32 \r
33         // Set the Window Class name\r
34         cs.lpszClass = _T("View");\r
35 \r
36         // Set the extended style\r
37         cs.dwExStyle = WS_EX_CLIENTEDGE;\r
38 }\r
39 \r
40 LRESULT CView::WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam)\r
41 {\r
42         switch (uMsg)\r
43         {\r
44         case WM_SIZE:\r
45                 Invalidate();\r
46                 break;  // Also do default processing\r
47         }\r
48 \r
49         // pass unhandled messages on for default processing\r
50         return WndProcDefault(uMsg, wParam, lParam);\r
51 }\r

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