Click here to Skip to main content
13,147,956 members (76,330 online)
Click here to Skip to main content

Stats

208K views
3K downloads
51 bookmarked
Posted 1 Feb 2002

Menu Bitmaps from Minimal Source Code

, 1 Feb 2002
Add bitmaps to your menus easily and with very little source code.
// BmpMenuView.cpp : implementation of the CBmpMenuView class
//

#include "stdafx.h"
#include "BmpMenu.h"

#include "BmpMenuDoc.h"
#include "BmpMenuView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CBmpMenuView

IMPLEMENT_DYNCREATE(CBmpMenuView, CView)

BEGIN_MESSAGE_MAP(CBmpMenuView, CView)
	//{{AFX_MSG_MAP(CBmpMenuView)
	//}}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()

/////////////////////////////////////////////////////////////////////////////
// CBmpMenuView construction/destruction

CBmpMenuView::CBmpMenuView()
{
}

CBmpMenuView::~CBmpMenuView()
{
}

BOOL CBmpMenuView::PreCreateWindow(CREATESTRUCT& cs)
{
	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CBmpMenuView drawing

void CBmpMenuView::OnDraw(CDC* pDC)
{
	CBmpMenuDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
}

/////////////////////////////////////////////////////////////////////////////
// CBmpMenuView printing

BOOL CBmpMenuView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CBmpMenuView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
}

void CBmpMenuView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
}

/////////////////////////////////////////////////////////////////////////////
// CBmpMenuView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CBmpMenuView message handlers

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)

Share

About the Author

Warren Gardner
United States United States
No Biography provided

You may also be interested in...

Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.170915.1 | Last Updated 2 Feb 2002
Article Copyright 2002 by Warren Gardner
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid