📄 mfcsid_matcomview.cpp
字号:
// MFCSID_MatcomView.cpp : implementation of the CMFCSID_MatcomView class
//
#include "stdafx.h"
#include "MFCSID_Matcom.h"
#include "MFCSID_MatcomDoc.h"
#include "MFCSID_MatcomView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMFCSID_MatcomView
IMPLEMENT_DYNCREATE(CMFCSID_MatcomView, CView)
BEGIN_MESSAGE_MAP(CMFCSID_MatcomView, CView)
//{{AFX_MSG_MAP(CMFCSID_MatcomView)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CMFCSID_MatcomView construction/destruction
CMFCSID_MatcomView::CMFCSID_MatcomView()
{
// TODO: add construction code here
}
CMFCSID_MatcomView::~CMFCSID_MatcomView()
{
}
BOOL CMFCSID_MatcomView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CMFCSID_MatcomView drawing
void CMFCSID_MatcomView::OnDraw(CDC* pDC)
{
CMFCSID_MatcomDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CRect recentClient;
GetClientRect(&recentClient);
xp=recentClient.Height();
yp=recentClient.Width();
}
/////////////////////////////////////////////////////////////////////////////
// CMFCSID_MatcomView printing
BOOL CMFCSID_MatcomView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CMFCSID_MatcomView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CMFCSID_MatcomView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CMFCSID_MatcomView diagnostics
#ifdef _DEBUG
void CMFCSID_MatcomView::AssertValid() const
{
CView::AssertValid();
}
void CMFCSID_MatcomView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CMFCSID_MatcomDoc* CMFCSID_MatcomView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMFCSID_MatcomDoc)));
return (CMFCSID_MatcomDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMFCSID_MatcomView message handlers
void CMFCSID_MatcomView::OnInitialUpdate()
{
CView::OnInitialUpdate();
m_h=winaxes(m_hWnd);
axesposition(0,0,757,450);
title((CL(TM("正弦函数y=sin(x)"))));
xlabel(CL(TM("x")));
ylabel(CL(TM("y")));
Mm x;
x=linspace(0,2*3.14,10000);
plot((CL(x),sin(x),TM("r")));
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -