childfrm.cpp

来自「数据结构链表的演示程序」· C++ 代码 · 共 110 行

CPP
110
字号
// ChildFrm.cpp : implementation of the CChildFrame class
//

#include "stdafx.h"
#include "LandSoft.h"
#include "lsview.h"
#include "ChildFrm.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CChildFrame

IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)

BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
	//{{AFX_MSG_MAP(CChildFrame)
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CChildFrame construction/destruction

CChildFrame::CChildFrame()
{
	
}

CChildFrame::~CChildFrame()
{
}

/////////////////////////////////////////////////////////////////////////////
// CChildFrame diagnostics

#ifdef _DEBUG
void CChildFrame::AssertValid() const
{
	CMDIChildWnd::AssertValid();
}

void CChildFrame::Dump(CDumpContext& dc) const
{
	CMDIChildWnd::Dump(dc);
}

#endif //_DEBUG



BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) 
{
	cs.style &=~WS_MAXIMIZEBOX;	
	cs.style &=~WS_THICKFRAME;
	return CMDIChildWnd::PreCreateWindow(cs);
}

static UINT BASED_CODE indicators[]=
{
	ID_INDICATOR_PIXELS,
	ID_INDICATOR_BYTES,
	ID_INDICATOR_COMPRESS
};

int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// If you pass AFX_IDW_STATUS_BAR instead of 101 as the ID, the status bar
	// can be toggled through the View Status Bar menu.
	m_bar.Create(this,WS_CHILD|WS_VISIBLE|CBRS_BOTTOM,101);
	m_bar.SetIndicators(indicators,sizeof(indicators)/sizeof(UINT));

	return 0;
}

void CChildFrame::OnUpdateFrameTitle(BOOL bAddToTitle)
{
	CDocument * pDoc=GetActiveDocument();

	if(bAddToTitle&&pDoc!=NULL)
	{
		CString strCurCaption,strWindowText,strNewCaption;

		GetWindowText(strCurCaption);

		GetActiveView()->GetWindowText(strWindowText);

		const CString& strDocTitle=pDoc->GetTitle();

		strNewCaption=strDocTitle;
		if(m_nWindow>0)
		{
			strNewCaption+=":";
			strNewCaption+=strWindowText;
		}

		if(strNewCaption!=strCurCaption)
			SetWindowText(strNewCaption);
	}

	GetMDIFrame()->OnUpdateFrameTitle(bAddToTitle);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?