zxd
2023-09-28 aac3b319965967f465881f3a8961904d57b6f337
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
// MyPaneRules.cpp : ÊµÏÖÎļþ
//
 
#include "pch.h"
#include "MTerm1.h"
#include "MyPaneLog.h"
 
 
// CMyPaneRules
 
IMPLEMENT_DYNAMIC(CMyPaneLog, CDockablePane)
 
CMyPaneLog::CMyPaneLog()
{
 
    m_pMyFormLog=(CMyFormLog*) (RUNTIME_CLASS(CMyFormLog)->CreateObject());
//    m_pMyDialogLog=(CMyDialogLog*) (RUNTIME_CLASS(CMyDialogLog)->CreateObject());
}
 
CMyPaneLog::~CMyPaneLog()
{
}
 
 
BEGIN_MESSAGE_MAP(CMyPaneLog, CDockablePane)
    ON_WM_CREATE()
    ON_WM_SIZE()
    ON_WM_DESTROY()
END_MESSAGE_MAP()
 
 
 
// CMyPaneRules ÏûÏ¢´¦Àí³ÌÐò
 
 
 
 
int CMyPaneLog::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CDockablePane::OnCreate(lpCreateStruct) == -1)
        return -1;
 
    // TODO:  ÔÚ´ËÌí¼ÓÄúרÓõĴ´½¨´úÂë
    RECT rect;   
 
    GetClientRect(&rect);     
 
//    m_pMyFormLog->CreateEx(NULL, _T("CMyPaneLog"),_T("ÈÕÖ¾´°¿Ú"), WS_CHILD | WS_VISIBLE, rect, this, IDD_FORM_LOG, NULL);
    m_pMyFormLog->Create(NULL, NULL,  WS_CHILD|WS_VISIBLE, rect, this, IDD_FORM_LOG, NULL);
//    m_MyDialogLog.Create(m_MyDialogLog.IDD,this);
//    m_MyDialogLog.ShowWindow(SW_SHOW);
//    m_MyDialogLog.OnInitDialog();
//    MyLogEdit1.Create(ES_MULTILINE|ES_WANTRETURN|WS_VSCROLL|WS_VISIBLE,rect,this,5678);
//    myLoger1.AttachWnd(MyLogEdit1.m_hWnd);
//    myLoger1.ShowTime=0;
//    myLoger1.showLineCount=0;
    return 0;
}
 
 
void CMyPaneLog::OnSize(UINT nType, int cx, int cy)
{
    CDockablePane::OnSize(nType, cx, cy);
 
    // TODO: ÔÚ´Ë´¦Ìí¼ÓÏûÏ¢´¦Àí³ÌÐò´úÂë
    if (GetSafeHwnd() == NULL) 
    { 
        return; 
    } 
/*
    if (MyLogEdit1.GetSafeHwnd()!=NULL)
    {
        CRect rect; 
        GetClientRect(rect); 
        MyLogEdit1.SetWindowPos(NULL, rect.left, rect.top, rect.Width(), rect.Height(), SWP_NOACTIVATE | SWP_NOZORDER); 
        MyLogEdit1.ReplaceSel(_T("On size \r\n"));
    }
    */
///*
    if(m_pMyFormLog->GetSafeHwnd()!=NULL) 
    { 
        CRect rect; 
        GetClientRect(rect); 
        m_pMyFormLog->SetWindowPos(NULL, rect.left, rect.top, rect.Width(), rect.Height(), SWP_NOACTIVATE | SWP_NOZORDER); 
    }
//*/
/*
    if(m_MyDialogLog.GetSafeHwnd()!=NULL) 
    { 
        CRect rect; 
        GetClientRect(rect); 
        m_MyDialogLog.SetWindowPos(NULL, rect.left, rect.top, rect.Width(), rect.Height(), SWP_NOACTIVATE | SWP_NOZORDER); 
    }
//*/
 
}
 
 
void CMyPaneLog::OnDestroy()
{
    CDockablePane::OnDestroy();
 
    // TODO: ÔÚ´Ë´¦Ìí¼ÓÏûÏ¢´¦Àí³ÌÐò´úÂë
}