Commit before breaking everything
[matches/honours.git] / research / transmission_spectroscopy / TOF / Win32++ / samples / DockTabbedMDI / src / Output.cpp
1 ///////////////////////////////////////////////////\r
2 // Output.cpp -  Definitions for the CViewOutput, CContainOutput\r
3 //              and CDockOutput classes\r
4 \r
5 \r
6 #include "stdafx.h"\r
7 #include "TabbedMDIApp.h"\r
8 #include "Output.h"\r
9 #include "resource.h"\r
10 \r
11 \r
12 ///////////////////////////////////////////////\r
13 // CViewOutput functions\r
14 CViewOutput::CViewOutput()\r
15 {\r
16         m_hRichEdit = ::LoadLibrary(_T("Riched20.dll")); // RichEdit ver 2.0\r
17     if (!m_hRichEdit)\r
18     {\r
19                 ::MessageBox(NULL,_T("CRichView::CRichView  Failed to load Riched20.dll"), _T(""), MB_ICONWARNING);\r
20     }\r
21 }\r
22 \r
23 CViewOutput::~CViewOutput(void)\r
24 {\r
25         if (m_hRichEdit)\r
26                 ::FreeLibrary(m_hRichEdit);\r
27 }\r
28 \r
29 void CViewOutput::OnInitialUpdate()\r
30 {\r
31         m_Font.CreateFont(16, 0, 0, 0, FW_NORMAL, 0, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS,\r
32                             CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_MODERN, _T("Courier New"));\r
33 \r
34         SetFont(&m_Font, FALSE);\r
35         SetWindowText(_T("Read Only Output Window"));\r
36 }\r
37 \r
38 void CViewOutput::PreCreate(CREATESTRUCT &cs)\r
39 {\r
40         cs.style = ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | WS_CHILD | \r
41                                 WS_CLIPCHILDREN | WS_HSCROLL | WS_VISIBLE | WS_VSCROLL | ES_READONLY;\r
42 \r
43         cs.lpszClass = RICHEDIT_CLASS; // RichEdit ver 2.0\r
44 }\r
45 \r
46 \r
47 //////////////////////////////////////////////\r
48 //  Definitions for the CContainOutput class\r
49 CContainOutput::CContainOutput() \r
50 {\r
51         SetView(m_ViewOutput); \r
52         SetDockCaption (_T("Output View - Docking container"));\r
53         SetTabText(_T("Output"));\r
54         SetTabIcon(IDI_TEXT);\r
55\r
56 \r
57 \r
58 //////////////////////////////////////////////\r
59 //  Definitions for the CDockOutput class\r
60 CDockOutput::CDockOutput()\r
61 {\r
62         // Set the view window to our edit control\r
63         SetView(m_View);\r
64 }\r
65 \r
66 void CDockOutput::OnInitialUpdate()\r
67 {\r
68         // Set the width of the splitter bar\r
69         SetBarWidth(8);\r
70 }\r
71 \r
72 \r

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