?? mydoc.cpp
字號:
// MyDoc.cpp : implementation of the CMyDoc class
//
#include "stdafx.h"
#include "My.h"
#include "MyDoc.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_COLOR_BLUE, OnColorBlue)
ON_COMMAND(ID_COLOR_RED, OnColorRed)
ON_COMMAND(ID_COLOR_YELLOW, OnColorYellow)
//}}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;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
m_dbXdata[0] = 1;
m_dbXdata[1] = 1.5;
m_dbXdata[2] = 2;
m_dbXdata[3] = 3;
m_dbXdata[4] = 4;
m_dbXdata[5] = 5;
m_dbXdata[6] = 6;
m_dbXdata[7] = 7;
m_dbXdata[8] = 8;
m_dbXdata[9] = 9;
m_dbYdata[0] = 22.5;
m_dbYdata[1] = 22.9;
m_dbYdata[2] = 31.4;
m_dbYdata[3] = 32.0;
m_dbYdata[4] = 32.5;
m_dbYdata[5] = 33;
m_dbYdata[6] = 33.6;
m_dbYdata[7] = 34.7;
m_dbYdata[8] = 34.9;
m_dbYdata[9] = 36;
m_colorrefColor = RGB(0,0,0);
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::OnColorBlue()
{
// TODO: Add your command handler code here
m_colorrefColor = RGB(0,0,255);
UpdateAllViews(NULL);
}
void CMyDoc::OnColorRed()
{
// TODO: Add your command handler code here
m_colorrefColor = RGB(255,0,0);
UpdateAllViews(NULL);
}
void CMyDoc::OnColorYellow()
{
// TODO: Add your command handler code here
m_colorrefColor = RGB(255,255,0);
UpdateAllViews(NULL);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -