// 10MappingMode1View.cpp : CMy10MappingMode1View 類別的實作
//

#include "stdafx.h"
#include "10MappingMode1.h"

#include "10MappingMode1Doc.h"
#include "10MappingMode1View.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CMy10MappingMode1View

IMPLEMENT_DYNCREATE(CMy10MappingMode1View, CView)

BEGIN_MESSAGE_MAP(CMy10MappingMode1View, CView)
	// 標準列印命令
	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()

// CMy10MappingMode1View 建構/解構

CMy10MappingMode1View::CMy10MappingMode1View()
{
	// TODO: 在此處加入建構程式碼

}

CMy10MappingMode1View::~CMy10MappingMode1View()
{
}

BOOL CMy10MappingMode1View::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: 經由修改 CREATESTRUCT cs 達到修改視窗類別或樣式的目的

	return CView::PreCreateWindow(cs);
}

// CMy10MappingMode1View 描繪

void CMy10MappingMode1View::OnDraw(CDC* pDC)
{
	CMy10MappingMode1Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);

	// TODO: 在此加入原生資料的繪製程式碼
    CRect rect;
    GetClientRect(&rect);
/*
    pDC->Ellipse(rect.Width()/4, rect.Height()/4, rect.Width()/4*3, rect.Height()/4*3);
    pDC->MoveTo(rect.Width()/2, rect.Height()/4);
    pDC->LineTo(rect.Width()/2, rect.Height()/2);
    pDC->LineTo(rect.Width()/4*3, rect.Height()/2);
*/
/*
    pDC->SetViewportOrg(CPoint(rect.Width()/2, rect.Height()/2)); 
    pDC->MoveTo(0, -rect.Height()/4);
    pDC->LineTo(0, 0);
    pDC->LineTo(rect.Width()/4, 0);
*/
/*
    pDC->SetViewportOrg(CPoint(rect.Width()/2, rect.Height()/2)); 
    pDC->SetMapMode(MM_LOENGLISH); 
    pDC->MoveTo(0, 100);
    pDC->LineTo(0, 0);
    pDC->LineTo(100, 0);
*/
/*
    pDC->SetMapMode(MM_LOENGLISH); 
    pDC->DPtoLP(&rect); 
    pDC->SetWindowOrg(-rect.Width()/2, -rect.Height()/2);
*/
    pDC->MoveTo(0, 100);
    pDC->LineTo(0, 0);
    pDC->LineTo(100, 0);
}


// CMy10MappingMode1View 列印

BOOL CMy10MappingMode1View::OnPreparePrinting(CPrintInfo* pInfo)
{
	// 預設的準備
	return DoPreparePrinting(pInfo);
}

void CMy10MappingMode1View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: 列印前加入額外的初始設定
}

void CMy10MappingMode1View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: 列印後加入清除
}


// CMy10MappingMode1View 診斷

#ifdef _DEBUG
void CMy10MappingMode1View::AssertValid() const
{
	CView::AssertValid();
}

void CMy10MappingMode1View::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CMy10MappingMode1Doc* CMy10MappingMode1View::GetDocument() const // 非偵錯版本是內嵌
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMy10MappingMode1Doc)));
	return (CMy10MappingMode1Doc*)m_pDocument;
}
#endif //_DEBUG


// CMy10MappingMode1View 訊息處理常式

void CMy10MappingMode1View::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
    // TODO: 在此加入特定的程式碼和 (或) 呼叫基底類別
    CRect rect;
    GetClientRect(&rect);
    pDC->SetMapMode(MM_LOENGLISH); 
    pDC->DPtoLP(&rect); 
    pDC->SetWindowOrg(-rect.Width()/2, -rect.Height()/2);

    CView::OnPrepareDC(pDC, pInfo);
}
