-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRichEditPane.cpp
66 lines (50 loc) · 1.28 KB
/
RichEditPane.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "pch.h"
#include "DatabaseExplorer.h"
#include "RichEditPane.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
IMPLEMENT_DYNAMIC(CRichEditPane, CNonClosableDockablePane)
CRichEditPane::CRichEditPane()
{
}
CRichEditPane::~CRichEditPane()
{
}
BEGIN_MESSAGE_MAP(CRichEditPane, CNonClosableDockablePane)
ON_WM_SIZE()
ON_WM_CLOSE()
ON_WM_SETFOCUS()
END_MESSAGE_MAP()
// CRichEditPane message handlers
void CRichEditPane::OnSize(UINT nType, int cx, int cy)
{
CNonClosableDockablePane::OnSize(nType, cx, cy);
AdjustLayout();
}
void CRichEditPane::AdjustLayout()
{
if (NULL == GetSafeHwnd())
return;
CRect rectClient;
GetClientRect(&rectClient);
m_pRichEditCtrl->SetWindowPos(NULL, rectClient.left, rectClient.top, rectClient.Width(), rectClient.Height(), SWP_NOACTIVATE | SWP_NOZORDER);
}
void CRichEditPane::OnClose()
{
// TODO: Add your specialized code here and/or call the base class
::PostMessage(m_pRichEditCtrl->GetParentOwner()->GetSafeHwnd(), WM_ACTIVATE, MAKEWPARAM(WA_ACTIVE, 0), 0);
return;
CNonClosableDockablePane::OnClose();
}
void CRichEditPane::OnSetFocus(CWnd* pOldWnd)
{
CNonClosableDockablePane::OnSetFocus(pOldWnd);
m_pRichEditCtrl->SetFocus();
}
CString CRichEditPane::GetText() const
{
CString sText;
m_pRichEditCtrl->GetWindowText(sText);
return sText;
}