Commit before breaking everything
[matches/honours.git] / research / transmission_spectroscopy / TOF / Win32++ / samples / DockContainer / src / Text.cpp
1 ///////////////////////////////////////////////////\r
2 // Text.cpp -  Definitions for the CViewText, \r
3 //              and CDockText classes\r
4 \r
5 #include "stdafx.h"\r
6 #include "ContainerApp.h"\r
7 #include "Text.h"\r
8 #include "resource.h"\r
9 \r
10 \r
11 ///////////////////////////////////////////////\r
12 // CViewText functions\r
13 CViewText::CViewText()\r
14 {\r
15         m_hRichEdit = ::LoadLibrary(_T("Riched20.dll")); // RichEdit ver 2.0\r
16     if (!m_hRichEdit)\r
17     {\r
18                 ::MessageBox(NULL,_T("CRichView::CRichView  Failed to load Riched20.dll"), _T(""), MB_ICONWARNING);\r
19     }\r
20 }\r
21 \r
22 CViewText::~CViewText(void)\r
23 {\r
24         // Free the DLL\r
25         if (m_hRichEdit)\r
26                 ::FreeLibrary(m_hRichEdit);\r
27 }\r
28 \r
29 void CViewText::OnInitialUpdate()\r
30 {\r
31         SetWindowText(_T("Text Edit Window\r\n\r\n You can type some text here ..."));\r
32 }\r
33 \r
34 void CViewText::PreCreate(CREATESTRUCT &cs)\r
35 {\r
36         cs.style = ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | WS_CHILD | \r
37                                 WS_CLIPCHILDREN | WS_HSCROLL | WS_VISIBLE | WS_VSCROLL;\r
38 \r
39         cs.lpszClass = RICHEDIT_CLASS; // RichEdit ver 2.0\r
40 }\r
41 \r
42 \r
43 //////////////////////////////////////////////\r
44 //  Definitions for the CContainText class\r
45 CContainText::CContainText() \r
46 {\r
47         SetDockCaption (_T("Text View - Docking container"));\r
48         SetTabText(_T("Text"));\r
49         SetTabIcon(IDI_TEXT);\r
50         SetView(m_ViewText);\r
51\r
52 \r
53 \r
54 //////////////////////////////////////////////\r
55 //  Definitions for the CDockText class\r
56 CDockText::CDockText()\r
57 {\r
58         // Set the view window to our edit control\r
59         SetView(m_View);\r
60 }\r
61 \r
62 void CDockText::OnInitialUpdate()\r
63 {\r
64         // Set the width of the splitter bar\r
65         SetBarWidth(8);\r
66 }\r
67 \r
68 \r

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