|
// shwcodeDoc.cpp : implementation of the CShwcodeDoc class
//
#include "stdafx.h"
#include "shwcode.h"
#include "shwcodeDoc.h"
#include "shwcodeView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CShwcodeDoc
IMPLEMENT_DYNCREATE(CShwcodeDoc, CDocument)
BEGIN_MESSAGE_MAP(CShwcodeDoc, CDocument)
//{{AFX_MSG_MAP(CShwcodeDoc)
ON_COMMAND(ID_VIEW_PATTERN1, OnViewPattern1)
ON_COMMAND(ID_VIEW_PATTERN2, OnViewPattern2)
ON_COMMAND(ID_VIEW_LOCKEDPATTERN, OnViewLockedpattern)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CShwcodeDoc construction/destruction
CShwcodeDoc::CShwcodeDoc()
{
// TODO: add one-time construction code here
}
CShwcodeDoc::~CShwcodeDoc()
{
}
BOOL CShwcodeDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CShwcodeDoc serialization
void CShwcodeDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CShwcodeDoc diagnostics
#ifdef _DEBUG
void CShwcodeDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CShwcodeDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CShwcodeDoc commands
void CShwcodeDoc::OnViewPattern1()
{
CShwcodeView*pv=NULL;
pv=(CShwcodeView*)GetPatternView();
if(!pv) return;
pv->SetDrawMode(1);
pv->RedrawWindow();
}
void CShwcodeDoc::OnViewPattern2()
{
CShwcodeView*pv=NULL;
pv=(CShwcodeView*)GetPatternView();
if(!pv) return;
pv->SetDrawMode(2);
pv->RedrawWindow();
}
void CShwcodeDoc::OnViewLockedpattern()
{
CShwcodeView*pv=NULL;
pv=(CShwcodeView*)GetPatternView();
if(!pv) return;
pv->SetDrawMode(3);
pv->RedrawWindow();
}
DWORD CShwcodeDoc::GetPatternView()
{
POSITION pos=this->GetFirstViewPosition();
CView*pv=this->GetNextView(pos);
return (DWORD)pv;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.