?? 數(shù)控插補(bǔ)程序doc.cpp
字號:
// 數(shù)控插補(bǔ)程序Doc.cpp : implementation of the CMyDoc class
//
#include "stdafx.h"
#include "數(shù)控插補(bǔ)程序.h"
#include "數(shù)控插補(bǔ)程序Doc.h"
#include "Line.h"
#include "Arc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyDoc
IMPLEMENT_DYNCREATE(CMyDoc, CDocument)
BEGIN_MESSAGE_MAP(CMyDoc, CDocument)
//{{AFX_MSG_MAP(CMyDoc)
ON_COMMAND(ID_LINE, OnLine)
ON_COMMAND(ID_ARC, OnArc)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyDoc construction/destruction
CMyDoc::CMyDoc()
{
// TODO: add one-time construction code here
}
CMyDoc::~CMyDoc()
{
}
BOOL CMyDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
step=10;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMyDoc serialization
void CMyDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CMyDoc diagnostics
#ifdef _DEBUG
void CMyDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CMyDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMyDoc commands
void CMyDoc::OnLine()
{
// TODO: Add your command handler code here
CLine Dlg;
if(Dlg.DoModal()==IDOK)
{
x1=Dlg.m_x1;
y1=Dlg.m_y1;
x2=Dlg.m_x2;
y2=Dlg.m_y2;
step=Dlg.m_step;
UpdateAllViews(NULL);
}
m1=n1=m2=n2=r=0;
}
void CMyDoc::OnArc()
{
// TODO: Add your command handler code here
CArc inputDlg;
if(inputDlg.DoModal()==IDOK)
{
m1=inputDlg.m_m1;
m2=inputDlg.m_m2;
n1=inputDlg.m_n1;
n2=inputDlg.m_n2;
r=inputDlg.m_r;
bc=inputDlg.m_b;
UpdateAllViews(NULL);
}
x1=y1=x2=y2=0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -