📄 addcustommessagetotoolbarview.cpp
字号:
// AddCustomMessageToToolBarView.cpp : implementation of the CAddCustomMessageToToolBarView class
//
#include "stdafx.h"
#include "AddCustomMessageToToolBar.h"
#include "AddCustomMessageToToolBarDoc.h"
#include "AddCustomMessageToToolBarView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAddCustomMessageToToolBarView
IMPLEMENT_DYNCREATE(CAddCustomMessageToToolBarView, CView)
BEGIN_MESSAGE_MAP(CAddCustomMessageToToolBarView, CView)
//{{AFX_MSG_MAP(CAddCustomMessageToToolBarView)
// 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, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAddCustomMessageToToolBarView construction/destruction
CAddCustomMessageToToolBarView::CAddCustomMessageToToolBarView()
{
// TODO: add construction code here
}
CAddCustomMessageToToolBarView::~CAddCustomMessageToToolBarView()
{
}
BOOL CAddCustomMessageToToolBarView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CAddCustomMessageToToolBarView drawing
void CAddCustomMessageToToolBarView::OnDraw(CDC* pDC)
{
CAddCustomMessageToToolBarDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
//TODO: add draw code for native data here
pDC->TextOut(0,8,"请将光标放在工具栏最后两个按钮上查看效果!");
#define Line 10
#define Col 9
int i,j;
int glox[Line][Col];
for (i=0;i<Line;i++)
{
for(j=0;j<Col;j++)
glox[i][j]=131+i*26+j*26;
}
for (i=0;i<Line;i++)
{
for(j=0;j<Col;j++)
{
CString str="";
str.Format("%3d",glox[i][j]);
pDC->TextOut(0+j*48,48+i*20,str,sizeof(glox[0][0])-1);
}
}
}
/////////////////////////////////////////////////////////////////////////////
// CAddCustomMessageToToolBarView printing
BOOL CAddCustomMessageToToolBarView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CAddCustomMessageToToolBarView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CAddCustomMessageToToolBarView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CAddCustomMessageToToolBarView diagnostics
#ifdef _DEBUG
void CAddCustomMessageToToolBarView::AssertValid() const
{
CView::AssertValid();
}
void CAddCustomMessageToToolBarView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CAddCustomMessageToToolBarDoc* CAddCustomMessageToToolBarView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAddCustomMessageToToolBarDoc)));
return (CAddCustomMessageToToolBarDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CAddCustomMessageToToolBarView message handlers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -