-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathLog.cpp
109 lines (89 loc) · 2.14 KB
/
Log.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// Log.cpp : implementation file
//
#include "stdafx.h"
#include "exe2c_gui.h"
#include "Log.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CLog dialog
CLog::CLog(CWnd* pParent /*=NULL*/)
: CDialog(CLog::IDD, pParent)
{
//{{AFX_DATA_INIT(CLog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CLog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLog)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CLog, CDialog)
//{{AFX_MSG_MAP(CLog)
ON_WM_SHOWWINDOW()
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLog message handlers
/*void CLog::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
if(nType ==SIZE_RESTORED)
{
CRect r;
this->GetClientRect(&r);
CEdit *p = (CEdit *)GetDlgItem(IDC_EDIT1);
if(NULL != p->GetSafeHwnd())
{
p->MoveWindow(r);
p->GetClientRect(&r);
}
}
}
void CLog::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
CEdit *p = (CEdit *)GetDlgItem(IDC_EDIT1);
p->SetWindowText(this->buf);
// TODO: Add your message handler code here
}*/
void CLog::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
if(nType ==SIZE_RESTORED)
{
CRect r;
this->GetClientRect(&r);
CEdit *p = (CEdit *)GetDlgItem(IDC_EDIT1);
if(NULL != p->GetSafeHwnd())
{
p->MoveWindow(r);
p->GetClientRect(&r);
}
}
}
void CLog::AddLine(PCSTR str)
{
//MessageBox("asdfasd", str,MB_OK);
CEdit *p = (CEdit *)GetDlgItem(IDC_EDIT1);
strcpy(this->buf,str);
char *s = strchr(buf,'\n');
if(s != NULL)
{
strcpy(s, "\r\n");
}//*/
if (p != NULL)
{
p->ReplaceSel(buf);
}
//MessageBox("asdfasd","adsf",MB_OK);
}