hanzifreqview.cpp

来自「汉字字频统计软件说明: 1. 这个小工具可以对一个文本文件中出现的汉字的字」· C++ 代码 · 共 111 行

CPP
111
字号
// HanZiFreqView.cpp : implementation of the CHanZiFreqView class
//

#include "stdafx.h"
#include "HanZiFreq.h"

#include "HanZiFreqDoc.h"
#include "CntrItem.h"
#include "HanZiFreqView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CHanZiFreqView

IMPLEMENT_DYNCREATE(CHanZiFreqView, CRichEditView)

BEGIN_MESSAGE_MAP(CHanZiFreqView, CRichEditView)
	//{{AFX_MSG_MAP(CHanZiFreqView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CRichEditView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CRichEditView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CRichEditView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHanZiFreqView construction/destruction

CHanZiFreqView::CHanZiFreqView()
{
	// TODO: add construction code here

}

CHanZiFreqView::~CHanZiFreqView()
{
}

BOOL CHanZiFreqView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CRichEditView::PreCreateWindow(cs);
}

void CHanZiFreqView::OnInitialUpdate()
{
	CRichEditView::OnInitialUpdate();


	// Set the printing margins (720 twips = 1/2 inch).
	SetMargins(CRect(720, 720, 720, 720));
}

/////////////////////////////////////////////////////////////////////////////
// CHanZiFreqView printing

BOOL CHanZiFreqView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}


void CHanZiFreqView::OnDestroy()
{
	// Deactivate the item on destruction; this is important
	// when a splitter view is being used.
   CRichEditView::OnDestroy();
   COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
   if (pActiveItem != NULL && pActiveItem->GetActiveView() == this)
   {
      pActiveItem->Deactivate();
      ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
   }
}


/////////////////////////////////////////////////////////////////////////////
// CHanZiFreqView diagnostics

#ifdef _DEBUG
void CHanZiFreqView::AssertValid() const
{
	CRichEditView::AssertValid();
}

void CHanZiFreqView::Dump(CDumpContext& dc) const
{
	CRichEditView::Dump(dc);
}

CHanZiFreqDoc* CHanZiFreqView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CHanZiFreqDoc)));
	return (CHanZiFreqDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CHanZiFreqView message handlers

⌨️ 快捷键说明

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