1 ///////////////////////////////////////////////////
\r
2 // Text.cpp - Definitions for the CViewText,
\r
3 // and CDockText classes
\r
6 #include "ContainerApp.h"
\r
8 #include "resource.h"
\r
11 ///////////////////////////////////////////////
\r
12 // CViewText functions
\r
13 CViewText::CViewText()
\r
15 m_hRichEdit = ::LoadLibrary(_T("Riched20.dll")); // RichEdit ver 2.0
\r
18 ::MessageBox(NULL,_T("CRichView::CRichView Failed to load Riched20.dll"), _T(""), MB_ICONWARNING);
\r
22 CViewText::~CViewText(void)
\r
26 ::FreeLibrary(m_hRichEdit);
\r
29 void CViewText::OnInitialUpdate()
\r
31 SetWindowText(_T("Text Edit Window\r\n\r\n You can type some text here ..."));
\r
34 void CViewText::PreCreate(CREATESTRUCT &cs)
\r
36 cs.style = ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | WS_CHILD |
\r
37 WS_CLIPCHILDREN | WS_HSCROLL | WS_VISIBLE | WS_VSCROLL;
\r
39 cs.lpszClass = RICHEDIT_CLASS; // RichEdit ver 2.0
\r
43 //////////////////////////////////////////////
\r
44 // Definitions for the CContainText class
\r
45 CContainText::CContainText()
\r
47 SetDockCaption (_T("Text View - Docking container"));
\r
48 SetTabText(_T("Text"));
\r
49 SetTabIcon(IDI_TEXT);
\r
50 SetView(m_ViewText);
\r
54 //////////////////////////////////////////////
\r
55 // Definitions for the CDockText class
\r
56 CDockText::CDockText()
\r
58 // Set the view window to our edit control
\r
62 void CDockText::OnInitialUpdate()
\r
64 // Set the width of the splitter bar
\r