⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smtpview.cpp

📁 vc stmp email 邮件系统 企业应用
💻 CPP
字号:
// smtpView.cpp : implementation of the CSmtpView class
//

#include "stdafx.h"
#include "smtp.h"

#include "smtpDoc.h"
#include "smtpView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSmtpView

IMPLEMENT_DYNCREATE(CSmtpView, CEditView)

BEGIN_MESSAGE_MAP(CSmtpView, CEditView)
	//{{AFX_MSG_MAP(CSmtpView)
	ON_COMMAND(ID_EDIT_ALL, OnEditAll)
	ON_COMMAND(ID_PREFERENCES_FONT, OnPreferencesFont)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSmtpView construction/destruction

CSmtpView::CSmtpView()
{
	// TODO: add construction code here
	m_Font.CreateFont(-16, 0, 0, 0, 400, 0, 0, 0, 134, 1, 2, 1, 49, _T("Fixedsys"));
}

CSmtpView::~CSmtpView()
{
}

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

	BOOL bPreCreated = CEditView::PreCreateWindow(cs);
	cs.style &= ~(ES_AUTOHSCROLL|WS_HSCROLL);	// Enable word-wrapping

	return bPreCreated;
}

/////////////////////////////////////////////////////////////////////////////
// CSmtpView drawing

void CSmtpView::OnDraw(CDC* pDC)
{
	CSmtpDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);

	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CSmtpView diagnostics

#ifdef _DEBUG
void CSmtpView::AssertValid() const
{
	CEditView::AssertValid();
}

void CSmtpView::Dump(CDumpContext& dc) const
{
	CEditView::Dump(dc);
}

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

/////////////////////////////////////////////////////////////////////////////
// CSmtpView message handlers

void CSmtpView::OnInitialUpdate() 
{
	CEditView::OnInitialUpdate();
	// TODO: Add your specialized code here and/or call the base class
	CEdit& m_Control = GetEditCtrl();
	m_Control.SetFont(&m_Font);
}

void CSmtpView::OnEditAll() 
{
	// TODO: Add your command handler code here
	CEdit& m_Edit = GetEditCtrl();
	m_Edit.SetSel(0, -1);
}

void CSmtpView::OnPreferencesFont() 
{
	// TODO: Add your command handler code here
	CFontDialog dlg;
	if (dlg.DoModal() == IDOK) {
		LOGFONT m_Logfont = dlg.m_lf;
		m_Font.DeleteObject();
		m_Font.CreateFontIndirect(&m_Logfont);
		CEdit& m_Edit = GetEditCtrl();
		m_Edit.SetFont(&m_Font, TRUE);
	}
}

⌨️ 快捷键说明

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