Click here to Skip to main content
15,894,825 members
Articles / Desktop Programming / MFC

The Ultimate Toolbox Home Page

Rate me:
Please Sign up or sign in to vote.
4.97/5 (141 votes)
25 Aug 2007CPOL13 min read 3.2M   91.4K   476  
The Ultimate Toolbox is now Open Source
// VisualStudioLikeDemoView.cpp : implementation of the CVisualStudioLikeDemoView class
//

#include "stdafx.h"
#include "VisualStudioLikeDemo.h"

#include "VisualStudioLikeDemoDoc.h"
#include "VisualStudioLikeDemoView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CVisualStudioLikeDemoView

IMPLEMENT_DYNCREATE(CVisualStudioLikeDemoView, CEditView)

BEGIN_MESSAGE_MAP(CVisualStudioLikeDemoView, CEditView)
	//{{AFX_MSG_MAP(CVisualStudioLikeDemoView)
	ON_UPDATE_COMMAND_UI(ID_EDIT_FIND, OnUpdateEditFind)
	ON_UPDATE_COMMAND_UI(ID_EDIT_FIND_IN_FILES, OnUpdateEditFindInFiles)
	//}}AFX_MSG_MAP
	// Standard printing commands
	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()

/////////////////////////////////////////////////////////////////////////////
// CVisualStudioLikeDemoView construction/destruction

CVisualStudioLikeDemoView::CVisualStudioLikeDemoView()
{
	// TODO: add construction code here

}

CVisualStudioLikeDemoView::~CVisualStudioLikeDemoView()
{
}

BOOL CVisualStudioLikeDemoView::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;
}

/////////////////////////////////////////////////////////////////////////////
// CVisualStudioLikeDemoView drawing

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

/////////////////////////////////////////////////////////////////////////////
// CVisualStudioLikeDemoView printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CVisualStudioLikeDemoView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CVisualStudioLikeDemoView message handlers

void CVisualStudioLikeDemoView::OnUpdateEditFind(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(TRUE);
}

void CVisualStudioLikeDemoView::OnUpdateEditFindInFiles(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(TRUE);
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Canada Canada
In January 2005, David Cunningham and Chris Maunder created TheUltimateToolbox.com, a new group dedicated to the continued development, support and growth of Dundas Software’s award winning line of MFC, C++ and ActiveX control products.

Ultimate Grid for MFC, Ultimate Toolbox for MFC, and Ultimate TCP/IP have been stalwarts of C++/MFC development for a decade. Thousands of developers have used these products to speed their time to market, improve the quality of their finished products, and enhance the reliability and flexibility of their software.
This is a Organisation

476 members

Comments and Discussions