smtpView.cpp
资源名称:mysmtp2.rar [点击查看]
上传用户:young001
上传日期:2007-07-04
资源大小:33k
文件大小:3k
源码类别:
WEB邮件程序
开发平台:
Visual C++
- // 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);
- }
- }