QuakeGod
2022-07-22 dd67df95a7303aee3bed65ffa935465f20ee8b32
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// MyFormLog.cpp : ÊµÏÖÎļþ
//
 
#include "pch.h"
#include "MTerm2.h"
#include "MyFormLog.h"
 
 
// CMyFormLog
 
IMPLEMENT_DYNCREATE(CMyFormLog, CFormView)
 
CMyFormLog::CMyFormLog()
    : CFormView(CMyFormLog::IDD)
{
 
}
 
CMyFormLog::~CMyFormLog()
{
}
 
void CMyFormLog::DoDataExchange(CDataExchange* pDX)
{
    CFormView::DoDataExchange(pDX);
//    DDX_Control(pDX, IDC_EDIT_LOG, m_edit_log);
    DDX_Control(pDX, IDC_RICHEDIT2_LOG, m_richedit_log);
}
 
BEGIN_MESSAGE_MAP(CMyFormLog, CFormView)
    ON_WM_CREATE()
    ON_WM_DESTROY()
    ON_WM_SIZE()
    ON_WM_MOUSEACTIVATE()
END_MESSAGE_MAP()
 
 
// CMyFormLog Õï¶Ï
 
#ifdef _DEBUG
void CMyFormLog::AssertValid() const
{
    CFormView::AssertValid();
}
 
#ifndef _WIN32_WCE
void CMyFormLog::Dump(CDumpContext& dc) const
{
    CFormView::Dump(dc);
}
#endif
#endif //_DEBUG
 
 
// CMyFormLog ÏûÏ¢´¦Àí³ÌÐò
 
 
BOOL CMyFormLog::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
    // TODO: ÔÚ´ËÌí¼ÓרÓôúÂëºÍ/»òµ÷ÓûùÀà
 
    return CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
}
 
 
int CMyFormLog::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CFormView::OnCreate(lpCreateStruct) == -1)
        return -1;
 
    // TODO:  ÔÚ´ËÌí¼ÓÄúרÓõĴ´½¨´úÂë
 
    return 0;
}
 
 
void CMyFormLog::OnDestroy()
{
    CFormView::OnDestroy();
 
    // TODO: ÔÚ´Ë´¦Ìí¼ÓÏûÏ¢´¦Àí³ÌÐò´úÂë
}
 
 
void CMyFormLog::OnSize(UINT nType, int cx, int cy)
{
    CFormView::OnSize(nType, cx, cy);
 
    // TODO: ÔÚ´Ë´¦Ìí¼ÓÏûÏ¢´¦Àí³ÌÐò´úÂë
    CWnd * pwnd;
    pwnd=GetDlgItem(IDC_RICHEDIT2_LOG);
    if (pwnd!=NULL)
    {
//        RECT    rect1;
        GetDlgItem(IDC_RICHEDIT2_LOG)->SetWindowPos(NULL,0,0,cx,cy-20,NULL);
    }
    pwnd=GetDlgItem(IDC_CHECK_PAUSE);
    if (pwnd!=NULL)
    {
        //RECT    rect1;
        CRect rect1;
        GetDlgItem(IDC_CHECK_PAUSE)->GetWindowRect(rect1);
        ScreenToClient(&rect1);
        GetDlgItem(IDC_CHECK_PAUSE)->SetWindowPos(NULL,0,cy-12,rect1.Width(),rect1.Height(),NULL);
    }
    pwnd=GetDlgItem(IDC_CHECK_NOSCROLL);
    if (pwnd!=NULL)
    {
        CRect rect1;
        GetDlgItem(IDC_CHECK_NOSCROLL)->GetWindowRect(rect1);
        ScreenToClient(&rect1);
        GetDlgItem(IDC_CHECK_NOSCROLL)->SetWindowPos(NULL,cx-rect1.Width(),cy-rect1.Height(),rect1.Width(),rect1.Height(),NULL);
    }
}
 
 
void CMyFormLog::OnInitialUpdate()
{
    CFormView::OnInitialUpdate();
 
    // TODO: ÔÚ´ËÌí¼ÓרÓôúÂëºÍ/»òµ÷ÓûùÀà
//    myLogger1.SetLogPathName(LogDirectory,_T("Run"));
    myLogger1.AttachWnd(m_richedit_log.m_hWnd);
    myLogger1.bShowLineCount=0;
    myLogger1.bShowTime=0;
}
 
 
int CMyFormLog::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
{
    // TODO: ÔÚ´ËÌí¼ÓÏûÏ¢´¦Àí³ÌÐò´úÂëºÍ/»òµ÷ÓÃĬÈÏÖµ
 
    return CFormView::OnMouseActivate(pDesktopWnd, nHitTest, message);
}