📄 accountinputview.cpp
字号:
// AccountInputView.cpp : implementation of the CAccountInputView class
//
#include "stdafx.h"
#include "AccountInput.h"
#include "AccountInputDoc.h"
#include "AccountInputView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAccountInputView
IMPLEMENT_DYNCREATE(CAccountInputView, CScrollView)
BEGIN_MESSAGE_MAP(CAccountInputView, CScrollView)
//{{AFX_MSG_MAP(CAccountInputView)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CScrollView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CScrollView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CScrollView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAccountInputView construction/destruction
CAccountInputView::CAccountInputView()
{
// TODO: add construction code here
}
CAccountInputView::~CAccountInputView()
{
}
BOOL CAccountInputView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CScrollView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CAccountInputView drawing
void CAccountInputView::OnDraw(CDC* pDC)
{
CAccountInputDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
//CRect rect;
//GetClientRect(&rect);
CFont myFont; //创建字体对象
//创建逻辑字体
myFont.CreateFont(
15, //字体高度(旋转后的字体宽度)=56
9, //字体宽度(旋转后的字体高度)=20
0, //字体显示角度=270°
0, //nOrientation=0
10, //字体磅数=10
FALSE, //非斜体
FALSE, //无下划线
FALSE, //无删除线
DEFAULT_CHARSET, //使用缺省字符集
OUT_STRING_PRECIS, //缺省输出精度
CLIP_DEFAULT_PRECIS,//缺省裁减精度
DEFAULT_QUALITY, //nQuality=缺省值
DEFAULT_PITCH, //nPitchAndFamily=缺省值
_T("仿宋体")); //字体名=@system
CFont *pOldFont=pDC->SelectObject(&myFont);//选入设备描述表
CRect rtClient;
GetClientRect(rtClient); //获取客户区尺寸、位置信息
pDC->SetTextAlign(TA_LEFT);
CStringArray strArray;
pDoc->GetPhrase(strArray);
int nNum=0;
nNum=strArray.GetSize();
for (int i=0;i<nNum;i++)
{
CString strTemp=strArray.GetAt(i);
pDC->TextOut(5,i*20+10, strTemp);
}
pDC->SelectObject(pOldFont); //将myFont从设备环境中分离
myFont.DeleteObject(); //删除myFont对象
}
/////////////////////////////////////////////////////////////////////////////
// CAccountInputView printing
BOOL CAccountInputView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CAccountInputView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CAccountInputView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CAccountInputView diagnostics
#ifdef _DEBUG
void CAccountInputView::AssertValid() const
{
CScrollView::AssertValid();
}
void CAccountInputView::Dump(CDumpContext& dc) const
{
CScrollView::Dump(dc);
}
CAccountInputDoc* CAccountInputView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAccountInputDoc)));
return (CAccountInputDoc*)m_pDocument;
}
#endif //_DEBUG
void CAccountInputView::OnInitialUpdate()
{
// TODO: Add your specialized code here and/or call the base class
SetScrollSizes(MM_TEXT, CSize(640,10000));
CScrollView::OnInitialUpdate();
}
void CAccountInputView::OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* /*pHint*/)
{
Invalidate();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -