【VC开源代码栏目提醒】:网学会员鉴于大家对VC开源代码十分关注,论文会员在此为大家搜集整理了“CMenu_7View.cpp”一文,供大家参考学习
// CMenu_7View.cpp : implementation of the CCMenu_7View class
//
#include "stdafx.h"
#include "CMenu_7.h"
#include "CMenu_7Doc.h"
#include "CMenu_7View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCMenu_7View
IMPLEMENT_DYNCREATE(CCMenu_7View, CView)
BEGIN_MESSAGE_MAP(CCMenu_7View, CView)
//{{AFX_MSG_MAP(CCMenu_7View)
ON_WM_RBUTTONDOWN()
ON_COMMAND(IDM_SHOW, OnShow)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CCMenu_7View construction/destruction
CCMenu_7View::CCMenu_7View()
{
// TODO: add construction code here
}
CCMenu_7View::~CCMenu_7View()
{
}
BOOL CCMenu_7View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CCMenu_7View drawing
void CCMenu_7View::OnDraw(CDC* pDC)
{
CCMenu_7Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CCMenu_7View printing
BOOL CCMenu_7View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CCMenu_7View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CCMenu_7View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CCMenu_7View diagnostics
#ifdef _DEBUG
void CCMenu_7View::AssertValid() const
{
CView::AssertValid();
}
void CCMenu_7View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CCMenu_7Doc* CCMenu_7View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCMenu_7Doc)));
return (CCMenu_7Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CCMenu_7View message handlers
void CCMenu_7View::OnRButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CMenu menu;
menu.LoadMenu(IDR_MENU1);
CMenu *pPopup=menu.GetSubMenu(0);
ClientToScreen(&point);
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y,
this);
CView::OnRButtonDown(nFlags, point);
}
void CCMenu_7View::OnShow()
{
// TODO: Add your command handler code here
MessageBox("右键弹出菜单测试!");
}
上一篇:
CMenu_7Doc.cpp
下一篇:
法律专业开题报告范文