?? fractralview.cpp
字號:
// FractralView.cpp : implementation of the CFractralView class
//
#include "stdafx.h"
#include "Fractral.h"
#include "FractralDoc.h"
#include "FractralView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFractralView
IMPLEMENT_DYNCREATE(CFractralView, CView)
BEGIN_MESSAGE_MAP(CFractralView, CView)
//{{AFX_MSG_MAP(CFractralView)
ON_COMMAND(ID_COUCH, OnCouch)
ON_COMMAND(ID_FLOOR, OnFloor)
ON_COMMAND(ID_TREE, OnTree)
ON_COMMAND(ID_RECT, OnRect)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CFractralView construction/destruction
CFractralView::CFractralView()
{
// TODO: add construction code here
nType=0;
}
CFractralView::~CFractralView()
{
}
BOOL CFractralView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CFractralView drawing
void CFractralView::OnDraw(CDC* pDC)
{
CFractralDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
switch(nType)
{
case 0:
Couch(pDC,0,300,300,300,6);
break;
case 1:
pDC->MoveTo(150,20);
pDC->LineTo(20,280);
pDC->LineTo(280,280);
pDC->LineTo(150,20);
Floor(pDC,150,20,20,280,280,280,6);
break;
case 2:
Rect(pDC,100,100,200,100,6);
Rect(pDC,200,100,200,200,6);
Rect(pDC,200,200,100,200,6);
Rect(pDC,100,200,100,100,6);
break;
case 3:
Tree(pDC,150,250,150,50,6);
break;
}
}
/////////////////////////////////////////////////////////////////////////////
// CFractralView printing
BOOL CFractralView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CFractralView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CFractralView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CFractralView diagnostics
#ifdef _DEBUG
void CFractralView::AssertValid() const
{
CView::AssertValid();
}
void CFractralView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CFractralDoc* CFractralView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CFractralDoc)));
return (CFractralDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CFractralView message handlers
void CFractralView::OnCouch()
{
// TODO: Add your command handler code here
nType=0;
Invalidate(TRUE);
}
void CFractralView::OnFloor()
{
// TODO: Add your command handler code here
nType=1;
Invalidate(TRUE);
}
void CFractralView::OnRect()
{
// TODO: Add your command handler code here
nType=2;
Invalidate(TRUE);
}
void CFractralView::OnTree()
{
// TODO: Add your command handler code here
nType=3;
Invalidate(TRUE);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -