// WizCViewView.cpp : implementation of the CWizCViewView class // #include "stdafx.h" #include "WizCView.h" #include "WizCViewDoc.h" #include "WizCViewView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CWizCViewView IMPLEMENT_DYNCREATE(CWizCViewView, CView) BEGIN_MESSAGE_MAP(CWizCViewView, CView) //{{AFX_MSG_MAP(CWizCViewView) // NOTE - the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code! //}}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() ///////////////////////////////////////////////////////////////////////////// // CWizCViewView construction/destruction CWizCViewView::CWizCViewView() { // TODO: add construction code here } CWizCViewView::~CWizCViewView() { } BOOL CWizCViewView::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return CView::PreCreateWindow(cs); } ///////////////////////////////////////////////////////////////////////////// // CWizCViewView drawing void CWizCViewView::OnDraw(CDC* pDC) { CWizCViewDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // prepare text font and color CFont font; font.CreatePointFont(200, _T("Tahoma")); pDC->SelectObject(&font); pDC->SetTextColor(RGB(155,20,20)); pDC->SetBkColor(RGB(255,255,190)); // prepare background color CBrush brush; brush.CreateSolidBrush(RGB(255,255,190)); pDC->SelectObject(&brush); // draw background CRect rect; GetClientRect(&rect); pDC->Rectangle(rect.left, rect.top, rect.right, rect.bottom); CPen pen; pen.CreatePen(PS_SOLID,2,RGB(155,20,20)); pDC->SelectObject(&pen); pDC->MoveTo(10,20); pDC->LineTo(518, 20); pDC->MoveTo(10,135); pDC->LineTo(518,135); // draw text LPCTSTR pText = _T( "\r\n CSE791 - Advanced Windows Programming" "\r\n Another Line" "\r\n And a Final Line" ); pDC->DrawText(pText, -1, &rect, DT_LEFT); } ///////////////////////////////////////////////////////////////////////////// // CWizCViewView printing BOOL CWizCViewView::OnPreparePrinting(CPrintInfo* pInfo) { // default preparation return DoPreparePrinting(pInfo); } void CWizCViewView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add extra initialization before printing } void CWizCViewView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add cleanup after printing } ///////////////////////////////////////////////////////////////////////////// // CWizCViewView diagnostics #ifdef _DEBUG void CWizCViewView::AssertValid() const { CView::AssertValid(); } void CWizCViewView::Dump(CDumpContext& dc) const { CView::Dump(dc); } CWizCViewDoc* CWizCViewView::GetDocument() // non-debug version is inline { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CWizCViewDoc))); return (CWizCViewDoc*)m_pDocument; } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CWizCViewView message handlers