📄 rulerdoc.cpp
字号:
// RulerDoc.cpp : implementation of the CRulerDoc class
//
#include "stdafx.h"
#include "new ruler.h"
#include "RulerDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRulerDoc
IMPLEMENT_DYNCREATE(CRulerDoc, CDocument)
BEGIN_MESSAGE_MAP(CRulerDoc, CDocument)
//{{AFX_MSG_MAP(CRulerDoc)
ON_COMMAND(ID_SETCOLOR_AUX, OnSetcolorAux)
ON_COMMAND(ID_SETCOLOR_FONT, OnSetcolorFont)
ON_COMMAND(ID_SETCOLOR_START, OnSetcolorStart)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRulerDoc construction/destruction
CRulerDoc::CRulerDoc()
{
// TODO: add one-time construction code here
m_ColorStart=RGB(255,0,0);
m_ColorAux=RGB(0,0,0);
m_ColorFont=RGB(0,0,0);
}
CRulerDoc::~CRulerDoc()
{
}
BOOL CRulerDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CRulerDoc serialization
void CRulerDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CRulerDoc diagnostics
#ifdef _DEBUG
void CRulerDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CRulerDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CRulerDoc commands
void CRulerDoc::OnSetcolorAux()
{
// TODO: Add your command handler code here
CColorDialog dlgColor;
if(dlgColor.DoModal()==IDOK)
{
m_ColorAux=dlgColor.GetColor();
}
}
void CRulerDoc::OnSetcolorFont()
{
// TODO: Add your command handler code here
CColorDialog dlgColor;
if(dlgColor.DoModal()==IDOK)
{
m_ColorFont=dlgColor.GetColor();
}
}
void CRulerDoc::OnSetcolorStart()
{
// TODO: Add your command handler code here
CColorDialog dlgColor;
if(dlgColor.DoModal()==IDOK)
{
m_ColorStart=dlgColor.GetColor();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -