📄 childfrm.cpp
字号:
// ChildFrm.cpp : implementation of the CChildFrame class
//
#include "stdafx.h"
#include "3104C.h"
#include "ChildFrm.h"
#include "mainfrm.h"
#include "3104cview.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CMainFrame *MainFrame;
/////////////////////////////////////////////////////////////////////////////
// CChildFrame
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CChildFrame)
ON_WM_CREATE()
ON_WM_CLOSE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChildFrame construction/destruction
CChildFrame::CChildFrame()
{
// TODO: add member initialization code here
}
CChildFrame::~CChildFrame()
{
}
//*************************************************************************************
//子框架窗口类的实现代码:
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
// m_strTitle = "第00号通道";
// ::SetWindowText (this->GetSafeHwnd(),m_strTitle);
// cs.style &= ~FWS_ADDTOTITLE;
// cs.style &= ~WS_MAXIMIZEBOX;
cs.style = WS_CHILD | WS_VISIBLE | WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU
| WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CChildFrame diagnostics
#ifdef _DEBUG
void CChildFrame::AssertValid() const
{
CMDIChildWnd::AssertValid();
}
void CChildFrame::Dump(CDumpContext& dc) const
{
CMDIChildWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CChildFrame message handlers
int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
return -1;
MainFrame->AddChildFrame (this);
return 0;
}
BOOL CChildFrame::DestroyWindow()
{
MainFrame->ClearChildFrame (this);
return CMDIChildWnd::DestroyWindow();
}
void CChildFrame::OnClose()
{
CMy3104CView *pView = (CMy3104CView *)this->GetActiveView();
if(pView == NULL) CMDIChildWnd::OnClose(); ;
CRichEditCtrl &p = (CRichEditCtrl &)pView->GetRichEditCtrl();
p.SetModify(FALSE);
CMDIChildWnd::OnClose();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -