Скачиваний:
12
Добавлен:
01.05.2014
Размер:
3.15 Кб
Скачать
// CompilerView.cpp : implementation of the CCompilerView class
//

#include "stdafx.h"
#include "Compiler.h"

#include "CompilerDoc.h"
#include "CompilerView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CCompilerView

IMPLEMENT_DYNCREATE(CCompilerView, CEditView)

BEGIN_MESSAGE_MAP(CCompilerView, CEditView)
	ON_COMMAND(ID_BUTTON_TEST, OnButtonTest)
	ON_WM_CREATE()
	ON_COMMAND(ID_FILE_PRINT, CEditView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CEditView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CEditView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCompilerView construction/destruction

CCompilerView::CCompilerView()
{
	// TODO: add construction code here
    m_Font.CreatePointFont(10, "Courier");
}

CCompilerView::~CCompilerView()
{
}

BOOL CCompilerView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	BOOL bPreCreated = CEditView::PreCreateWindow(cs);
	cs.style &= ~(ES_AUTOHSCROLL|WS_HSCROLL);	// Enable word-wrapping

	return bPreCreated;
}

/////////////////////////////////////////////////////////////////////////////
// CCompilerView drawing

void CCompilerView::OnDraw(CDC* pDC)
{
	CCompilerDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CCompilerView printing

BOOL CCompilerView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default CEditView preparation
	return CEditView::OnPreparePrinting(pInfo);
}

void CCompilerView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
	// Default CEditView begin printing.
	CEditView::OnBeginPrinting(pDC, pInfo);
}

void CCompilerView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
{
	// Default CEditView end printing
	CEditView::OnEndPrinting(pDC, pInfo);
}

/////////////////////////////////////////////////////////////////////////////
// CCompilerView diagnostics

#ifdef _DEBUG
void CCompilerView::AssertValid() const
{
	CEditView::AssertValid();
}

void CCompilerView::Dump(CDumpContext& dc) const
{
	CEditView::Dump(dc);
}

CCompilerDoc* CCompilerView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCompilerDoc)));
	return (CCompilerDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CCompilerView message handlers

void CCompilerView::OnButtonTest() 
{
    //Clear();
}

//-----------------------------------------------------------------------------

int CCompilerView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CEditView::OnCreate(lpCreateStruct) == -1)
		return -1;
	
    SetFont( &m_Font );
    SetTabStops(16);
	
	return 0;
}

//-----------------------------------------------------------------------------
Соседние файлы в папке Курсовая работа2