📄 fingerdemoview.cpp
字号:
// FingerDemoView.cpp : implementation of the CFingerDemoView class
//
#include "stdafx.h"
#include "FingerDemo.h"
#include "FingerDemoSet.h"
#include "FingerDemoDoc.h"
#include "FingerDemoView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFingerDemoView
IMPLEMENT_DYNCREATE(CFingerDemoView, CRecordView)
BEGIN_MESSAGE_MAP(CFingerDemoView, CRecordView)
//{{AFX_MSG_MAP(CFingerDemoView)
ON_WM_PAINT()
ON_WM_SHOWWINDOW()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CRecordView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CRecordView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CRecordView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFingerDemoView construction/destruction
CFingerDemoView::CFingerDemoView()
: CRecordView(CFingerDemoView::IDD)
{
//{{AFX_DATA_INIT(CFingerDemoView)
// NOTE: the ClassWizard will add member initialization here
m_pSet = NULL;
//}}AFX_DATA_INIT
// TODO: add construction code here
}
CFingerDemoView::~CFingerDemoView()
{
}
void CFingerDemoView::DoDataExchange(CDataExchange* pDX)
{
CRecordView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CFingerDemoView)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BOOL CFingerDemoView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CRecordView::PreCreateWindow(cs);
}
void CFingerDemoView::OnInitialUpdate()
{
m_pSet = &GetDocument()->m_fingerDemoSet;
CRecordView::OnInitialUpdate();
ResizeParentToFit();
}
/////////////////////////////////////////////////////////////////////////////
// CFingerDemoView printing
BOOL CFingerDemoView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CFingerDemoView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CFingerDemoView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CFingerDemoView diagnostics
#ifdef _DEBUG
void CFingerDemoView::AssertValid() const
{
CRecordView::AssertValid();
}
void CFingerDemoView::Dump(CDumpContext& dc) const
{
CRecordView::Dump(dc);
}
CFingerDemoDoc* CFingerDemoView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CFingerDemoDoc)));
return (CFingerDemoDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CFingerDemoView database support
CRecordset* CFingerDemoView::OnGetRecordset()
{
return m_pSet;
}
/////////////////////////////////////////////////////////////////////////////
// CFingerDemoView message handlers
void CFingerDemoView::OnDraw(CDC* pDC)
{
// TODO: Add your specialized code here and/or call the base class
}
void CFingerDemoView::OnPaint()
{
CPaintDC dc(this); // device context for painting
/* dc.m_ps.fErase=1;
CDC *pDC=GetDC();
pDC->SetMapMode(MM_TEXT);
GetDC()->SetBkMode(TRANSPARENT);
CBrush brush(RGB(255,0,0));
GetDC()->SelectObject(brush);
CPen newPen,pOldPen;
newPen.CreatePen( PS_SOLID, 2, RGB(255,0,0) ) ;
pDC->SelectObject( &newPen);
pDC->SelectObject(newPen);
GetDC()->SetBkColor(RGB(0,0,155));
GetDlgItem(IDC_STATIC_1)->GetDC()->SetTextColor(RGB(0,0,0));
GetDC()->TextOut(10,10,"helllllo");
GetDlgItem(IDC_STATIC_1)->GetDC()->SetBkColor(RGB(255,0,0));
*/
// TODO: Add your message handler code here]
// Do not call CRecordView::OnPaint() for painting messages
}
void CFingerDemoView::OnShowWindow(BOOL bShow, UINT nStatus)
{
// CRecordView::OnShowWindow(bShow, nStatus);
GetDC()->SetBkColor(RGB(0,0,155));
// TODO: Add your message handler code here
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -