提交 | 用户 | age
|
0ed438
|
1 |
// MyFormLog.cpp : 实现文件
|
Q |
2 |
//
|
|
3 |
|
|
4 |
#include "pch.h"
|
|
5 |
#include "MTerm2.h"
|
|
6 |
#include "MyFormLog.h"
|
|
7 |
|
|
8 |
|
|
9 |
// CMyFormLog
|
|
10 |
|
|
11 |
IMPLEMENT_DYNCREATE(CMyFormLog, CFormView)
|
|
12 |
|
|
13 |
CMyFormLog::CMyFormLog()
|
|
14 |
: CFormView(CMyFormLog::IDD)
|
|
15 |
{
|
|
16 |
|
|
17 |
}
|
|
18 |
|
|
19 |
CMyFormLog::~CMyFormLog()
|
|
20 |
{
|
|
21 |
}
|
|
22 |
|
|
23 |
void CMyFormLog::DoDataExchange(CDataExchange* pDX)
|
|
24 |
{
|
|
25 |
CFormView::DoDataExchange(pDX);
|
|
26 |
// DDX_Control(pDX, IDC_EDIT_LOG, m_edit_log);
|
|
27 |
DDX_Control(pDX, IDC_RICHEDIT2_LOG, m_richedit_log);
|
|
28 |
}
|
|
29 |
|
|
30 |
BEGIN_MESSAGE_MAP(CMyFormLog, CFormView)
|
|
31 |
ON_WM_CREATE()
|
|
32 |
ON_WM_DESTROY()
|
|
33 |
ON_WM_SIZE()
|
|
34 |
ON_WM_MOUSEACTIVATE()
|
|
35 |
END_MESSAGE_MAP()
|
|
36 |
|
|
37 |
|
|
38 |
// CMyFormLog 诊断
|
|
39 |
|
|
40 |
#ifdef _DEBUG
|
|
41 |
void CMyFormLog::AssertValid() const
|
|
42 |
{
|
|
43 |
CFormView::AssertValid();
|
|
44 |
}
|
|
45 |
|
|
46 |
#ifndef _WIN32_WCE
|
|
47 |
void CMyFormLog::Dump(CDumpContext& dc) const
|
|
48 |
{
|
|
49 |
CFormView::Dump(dc);
|
|
50 |
}
|
|
51 |
#endif
|
|
52 |
#endif //_DEBUG
|
|
53 |
|
|
54 |
|
|
55 |
// CMyFormLog 消息处理程序
|
|
56 |
|
|
57 |
|
|
58 |
BOOL CMyFormLog::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
|
|
59 |
{
|
|
60 |
// TODO: 在此添加专用代码和/或调用基类
|
|
61 |
|
|
62 |
return CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
|
|
63 |
}
|
|
64 |
|
|
65 |
|
|
66 |
int CMyFormLog::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
|
67 |
{
|
|
68 |
if (CFormView::OnCreate(lpCreateStruct) == -1)
|
|
69 |
return -1;
|
|
70 |
|
|
71 |
// TODO: 在此添加您专用的创建代码
|
|
72 |
|
|
73 |
return 0;
|
|
74 |
}
|
|
75 |
|
|
76 |
|
|
77 |
void CMyFormLog::OnDestroy()
|
|
78 |
{
|
|
79 |
CFormView::OnDestroy();
|
|
80 |
|
|
81 |
// TODO: 在此处添加消息处理程序代码
|
|
82 |
}
|
|
83 |
|
|
84 |
|
|
85 |
void CMyFormLog::OnSize(UINT nType, int cx, int cy)
|
|
86 |
{
|
|
87 |
CFormView::OnSize(nType, cx, cy);
|
|
88 |
|
|
89 |
// TODO: 在此处添加消息处理程序代码
|
|
90 |
CWnd * pwnd;
|
|
91 |
pwnd=GetDlgItem(IDC_RICHEDIT2_LOG);
|
|
92 |
if (pwnd!=NULL)
|
|
93 |
{
|
|
94 |
// RECT rect1;
|
|
95 |
GetDlgItem(IDC_RICHEDIT2_LOG)->SetWindowPos(NULL,0,0,cx,cy-20,NULL);
|
|
96 |
}
|
|
97 |
pwnd=GetDlgItem(IDC_CHECK_PAUSE);
|
|
98 |
if (pwnd!=NULL)
|
|
99 |
{
|
|
100 |
//RECT rect1;
|
|
101 |
CRect rect1;
|
|
102 |
GetDlgItem(IDC_CHECK_PAUSE)->GetWindowRect(rect1);
|
|
103 |
ScreenToClient(&rect1);
|
|
104 |
GetDlgItem(IDC_CHECK_PAUSE)->SetWindowPos(NULL,0,cy-12,rect1.Width(),rect1.Height(),NULL);
|
|
105 |
}
|
|
106 |
pwnd=GetDlgItem(IDC_CHECK_NOSCROLL);
|
|
107 |
if (pwnd!=NULL)
|
|
108 |
{
|
|
109 |
CRect rect1;
|
|
110 |
GetDlgItem(IDC_CHECK_NOSCROLL)->GetWindowRect(rect1);
|
|
111 |
ScreenToClient(&rect1);
|
|
112 |
GetDlgItem(IDC_CHECK_NOSCROLL)->SetWindowPos(NULL,cx-rect1.Width(),cy-rect1.Height(),rect1.Width(),rect1.Height(),NULL);
|
|
113 |
}
|
|
114 |
}
|
|
115 |
|
|
116 |
|
|
117 |
void CMyFormLog::OnInitialUpdate()
|
|
118 |
{
|
|
119 |
CFormView::OnInitialUpdate();
|
|
120 |
|
|
121 |
// TODO: 在此添加专用代码和/或调用基类
|
|
122 |
// myLogger1.SetLogPathName(LogDirectory,_T("Run"));
|
|
123 |
myLogger1.AttachWnd(m_richedit_log.m_hWnd);
|
|
124 |
myLogger1.bShowLineCount=0;
|
|
125 |
myLogger1.bShowTime=0;
|
|
126 |
}
|
|
127 |
|
|
128 |
|
|
129 |
int CMyFormLog::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
|
|
130 |
{
|
|
131 |
// TODO: 在此添加消息处理程序代码和/或调用默认值
|
|
132 |
|
|
133 |
return CFormView::OnMouseActivate(pDesktopWnd, nHitTest, message);
|
|
134 |
}
|