-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathChildFrm.cpp
105 lines (78 loc) · 2.19 KB
/
ChildFrm.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
// ChildFrm.cpp : CChildFrame 类的实现
//
#include "stdafx.h"
#include "FA2013.h"
#include "ChildFrm.h"
#include"AView.h"
#include"DView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CChildFrame
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWndEx)
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWndEx)
// ON_WM_SETCURSOR()
ON_WM_CREATE()
END_MESSAGE_MAP()
// CChildFrame 构造/析构
CChildFrame::CChildFrame()
{
// TODO: 在此添加成员初始化代码
}
CChildFrame::~CChildFrame()
{
}
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: 在此处通过修改 CREATESTRUCT cs 来修改窗口类或样式
if( !CMDIChildWndEx::PreCreateWindow(cs) )
return FALSE;
cs.style = WS_CHILD | WS_VISIBLE | WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU
| FWS_ADDTOTITLE | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_MAXIMIZE;
return TRUE;
}
// CChildFrame 诊断
#ifdef _DEBUG
void CChildFrame::AssertValid() const
{
CMDIChildWndEx::AssertValid();
}
void CChildFrame::Dump(CDumpContext& dc) const
{
CMDIChildWndEx::Dump(dc);
}
#endif //_DEBUG
// CChildFrame 消息处理程序
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: 在此添加专用代码和/或调用基类
CRect rect;
//GetClientRect(&rect);
this->GetWindowRect(&rect);
m_wndSplitter.CreateStatic(this,2,1);
m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CAView),CSize(rect.Width(),rect.Height()/4*3),pContext);
m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(CDView),CSize(rect.Width(),100),pContext);
return true;
//return CMDIChildWndEx::OnCreateClient(lpcs, pContext);
}
//BOOL CChildFrame::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
//{
// // TODO: 在此添加消息处理程序代码和/或调用默认值
// return TRUE;
// //return CMDIChildWndEx::OnSetCursor(pWnd, nHitTest, message);
//}
int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIChildWndEx::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: 在此添加您专用的创建代码
m_StatusBar.Create(this);
static UINT indicators[] = {
ID_INDICATOR_CURSOR1,
ID_INDICATOR_CURSOR2,
ID_INDICATOR_BLANK,
ID_INDICATOR_PROGRESS};
m_StatusBar.SetIndicators(indicators,sizeof(indicators)/sizeof(UINT));
m_StatusBar.SetPaneStyle(2,SBPS_STRETCH|SBPS_NOBORDERS);
return 0;
}