|
// MyView.cpp : implementation file
//
#include "stdafx.h"
#include "mymenu.h"
#include "MyView.h"
#include "BCMenu.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyView
IMPLEMENT_DYNCREATE(CMyView, CView)
CMyView::CMyView()
{
}
CMyView::~CMyView()
{
}
BEGIN_MESSAGE_MAP(CMyView, CView)
//{{AFX_MSG_MAP(CMyView)
ON_WM_RBUTTONDOWN()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyView drawing
void CMyView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CMyView diagnostics
#ifdef _DEBUG
void CMyView::AssertValid() const
{
CView::AssertValid();
}
void CMyView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMyView message handlers
void CMyView::OnRButtonDown(UINT nFlags, CPoint point)
{
static UINT toolbars[]={
IDR_MAINFRAME,
IDR_TOOLBAR
};
BCMenu menuPopup;
menuPopup.CreatePopupMenu();
menuPopup.AppendMenu(MF_STRING,ID_EDIT_CUT,_T("Cu&t\tCtrl+X"));
menuPopup.AppendMenu(MF_STRING,ID_EDIT_COPY,_T("&Copy\tCtrl+C"));
menuPopup.AppendMenu(MF_STRING,ID_EDIT_PASTE,_T("&Paste\tCtrl+V"));
menuPopup.AppendMenu(MF_STRING,ID_ZOOM,_T("&Zoom"));
menuPopup.LoadToolbars(toolbars,2);
ClientToScreen(&point);
menuPopup.TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON,point.x,point.y,this);
menuPopup.DestroyMenu();
}
|
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.
I'm the senior software development manager for Rocscience Inc., a company specializing in geomechanics software. I have a PH.D in Civil Engineering, and have been programming since 1978. I've used more computers and languages then 2000 characters lets me list. Besides programming, I enjoy golfing, watching my 3 kids play sports, spending time with my wife, and watching plenty of hockey and football.