102 lines
2.3 KiB
C++
102 lines
2.3 KiB
C++
// MapEditView.cpp : implementation of the CMapEditView class
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include <gl\gl.h>
|
|
#include <gl\glu.h>
|
|
#include <gl\glut.h>
|
|
#include "GLEnabledView.h"
|
|
|
|
#include "MapEdit.h"
|
|
|
|
#include "MapEditDoc.h"
|
|
#include "MapEditView.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CMapEditView
|
|
|
|
IMPLEMENT_DYNCREATE(CMapEditView, CGLEnabledView)
|
|
|
|
BEGIN_MESSAGE_MAP(CMapEditView, CGLEnabledView)
|
|
//{{AFX_MSG_MAP(CMapEditView)
|
|
ON_WM_SETFOCUS()
|
|
//}}AFX_MSG_MAP
|
|
// Standard printing commands
|
|
ON_COMMAND(ID_FILE_PRINT, CGLEnabledView::OnFilePrint)
|
|
ON_COMMAND(ID_FILE_PRINT_DIRECT, CGLEnabledView::OnFilePrint)
|
|
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CGLEnabledView::OnFilePrintPreview)
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CMapEditView construction/destruction
|
|
|
|
CMapEditView::CMapEditView()
|
|
{
|
|
TRACE0("Here");
|
|
// TODO: add construction code here
|
|
|
|
}
|
|
|
|
CMapEditView::~CMapEditView()
|
|
{
|
|
}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CMapEditView printing
|
|
|
|
BOOL CMapEditView::OnPreparePrinting(CPrintInfo* pInfo)
|
|
{
|
|
// default preparation
|
|
return DoPreparePrinting(pInfo);
|
|
}
|
|
|
|
void CMapEditView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
|
|
{
|
|
// TODO: add extra initialization before printing
|
|
}
|
|
|
|
void CMapEditView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
|
|
{
|
|
// TODO: add cleanup after printing
|
|
}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CMapEditView diagnostics
|
|
|
|
#ifdef _DEBUG
|
|
void CMapEditView::AssertValid() const
|
|
{
|
|
CGLEnabledView::AssertValid();
|
|
}
|
|
|
|
void CMapEditView::Dump(CDumpContext& dc) const
|
|
{
|
|
CGLEnabledView::Dump(dc);
|
|
}
|
|
|
|
CMapEditDoc* CMapEditView::GetDocument() // non-debug version is inline
|
|
{
|
|
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMapEditDoc)));
|
|
return (CMapEditDoc*)m_pDocument;
|
|
}
|
|
#endif //_DEBUG
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CMapEditView message handlers
|
|
|
|
void CMapEditView::OnSetFocus(CWnd* pOldWnd)
|
|
{
|
|
|
|
CMapEditDoc *CurDoc=GetDocument();
|
|
CGLEnabledView::OnSetFocus(pOldWnd);
|
|
theApp.SetCurrent(CurDoc);
|
|
|
|
CurDoc->UpdateAll(); // woohoo, that was easy
|
|
}
|