📄 calendertestview.cpp
字号:
// CalenderTestView.cpp : implementation of the CCalenderTestView class
//
#include "stdafx.h"
#include "CalenderTest.h"
#include "CalenderTestDoc.h"
#include "CalenderTestView.h"
#include "ActiveXDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCalenderTestView
IMPLEMENT_DYNCREATE(CCalenderTestView, CView)
BEGIN_MESSAGE_MAP(CCalenderTestView, CView)
//{{AFX_MSG_MAP(CCalenderTestView)
ON_WM_LBUTTONDOWN()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCalenderTestView construction/destruction
CCalenderTestView::CCalenderTestView()
{
// TODO: add construction code here
}
CCalenderTestView::~CCalenderTestView()
{
}
BOOL CCalenderTestView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CCalenderTestView drawing
void CCalenderTestView::OnDraw(CDC* pDC)
{
CCalenderTestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CCalenderTestView printing
BOOL CCalenderTestView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CCalenderTestView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CCalenderTestView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CCalenderTestView diagnostics
#ifdef _DEBUG
void CCalenderTestView::AssertValid() const
{
CView::AssertValid();
}
void CCalenderTestView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CCalenderTestDoc* CCalenderTestView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCalenderTestDoc)));
return (CCalenderTestDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CCalenderTestView message handlers
void CCalenderTestView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CActiveXDialog dlg;
dlg.m_BackColor = RGB(255, 251, 240); // light yellow
COleDateTime today = COleDateTime::GetCurrentTime();
dlg.m_varValue = COleDateTime(today.GetYear(), today.GetMonth(),
today.GetDay(), 0, 0, 0);
if (dlg.DoModal() == IDOK) {
COleDateTime date(dlg.m_varValue);
AfxMessageBox(date.Format("%B %d, %Y"));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -