提交 | 用户 | age
|
418cb3
|
1 |
|
Q |
2 |
// MainFrm.cpp: CMainFrame 类的实现
|
|
3 |
//
|
|
4 |
|
|
5 |
#include "pch.h"
|
|
6 |
#include "framework.h"
|
|
7 |
#include "ConfigTool.h"
|
|
8 |
|
|
9 |
#include "MainFrm.h"
|
|
10 |
|
|
11 |
#ifdef _DEBUG
|
|
12 |
#define new DEBUG_NEW
|
|
13 |
#endif
|
|
14 |
|
|
15 |
// CMainFrame
|
|
16 |
|
|
17 |
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
|
|
18 |
|
|
19 |
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
|
|
20 |
ON_WM_CREATE()
|
|
21 |
END_MESSAGE_MAP()
|
|
22 |
|
|
23 |
static UINT indicators[] =
|
|
24 |
{
|
|
25 |
ID_SEPARATOR, // 状态行指示器
|
|
26 |
ID_INDICATOR_CAPS,
|
|
27 |
ID_INDICATOR_NUM,
|
|
28 |
ID_INDICATOR_SCRL,
|
|
29 |
};
|
|
30 |
|
|
31 |
// CMainFrame 构造/析构
|
|
32 |
|
|
33 |
CMainFrame::CMainFrame() noexcept
|
|
34 |
{
|
|
35 |
// TODO: 在此添加成员初始化代码
|
|
36 |
}
|
|
37 |
|
|
38 |
CMainFrame::~CMainFrame()
|
|
39 |
{
|
|
40 |
}
|
|
41 |
|
|
42 |
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
|
43 |
{
|
|
44 |
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
|
|
45 |
return -1;
|
|
46 |
|
|
47 |
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
|
|
48 |
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
|
|
49 |
{
|
|
50 |
TRACE0("未能创建工具栏\n");
|
|
51 |
return -1; // 未能创建
|
|
52 |
}
|
|
53 |
|
|
54 |
if (!m_wndStatusBar.Create(this))
|
|
55 |
{
|
|
56 |
TRACE0("未能创建状态栏\n");
|
|
57 |
return -1; // 未能创建
|
|
58 |
}
|
|
59 |
m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
|
|
60 |
|
|
61 |
// TODO: 如果不需要可停靠工具栏,则删除这三行
|
|
62 |
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
|
|
63 |
EnableDocking(CBRS_ALIGN_ANY);
|
|
64 |
DockControlBar(&m_wndToolBar);
|
|
65 |
|
|
66 |
|
|
67 |
return 0;
|
|
68 |
}
|
|
69 |
|
|
70 |
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
|
|
71 |
{
|
|
72 |
if( !CFrameWnd::PreCreateWindow(cs) )
|
|
73 |
return FALSE;
|
|
74 |
// TODO: 在此处通过修改
|
|
75 |
// CREATESTRUCT cs 来修改窗口类或样式
|
|
76 |
|
|
77 |
return TRUE;
|
|
78 |
}
|
|
79 |
|
|
80 |
// CMainFrame 诊断
|
|
81 |
|
|
82 |
#ifdef _DEBUG
|
|
83 |
void CMainFrame::AssertValid() const
|
|
84 |
{
|
|
85 |
CFrameWnd::AssertValid();
|
|
86 |
}
|
|
87 |
|
|
88 |
void CMainFrame::Dump(CDumpContext& dc) const
|
|
89 |
{
|
|
90 |
CFrameWnd::Dump(dc);
|
|
91 |
}
|
|
92 |
#endif //_DEBUG
|
|
93 |
|
|
94 |
|
|
95 |
// CMainFrame 消息处理程序
|
|
96 |
|