【VC开源代码栏目提醒】:网学会员--在 VC开源代码编辑为广大网友搜集整理了:Ex05_2View.cpp绩等信息,祝愿广大网友取得需要的信息,参考学习。
// Ex05_2View.cpp : implementation of the CEx05_2View class
//
#include "stdafx.h"
#include "Ex05_2.h"
#include "Ex05_2Doc.h"
#include "Ex05_2View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CEx05_2View
IMPLEMENT_DYNCREATE(CEx05_2View, CView)
BEGIN_MESSAGE_MAP(CEx05_2View, CView)
//{{AFX_MSG_MAP(CEx05_2View)
ON_COMMAND(ID_TEST_BMPMENU, OnTestBmpmenu)
ON_UPDATE_COMMAND_UI(ID_TEST_BMPMENU, OnUpdateTestBmpmenu)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CEx05_2View construction/destruction
CEx05_2View::CEx05_2View()
{
// TODO: add construction code here
bitmap1.LoadBitmap(IDB_BITMAP1);
bitmap2.LoadBitmap(IDB_BITMAP2);
bCheck=1;
}
CEx05_2View::~CEx05_2View()
{
}
BOOL CEx05_2View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CEx05_2View drawing
void CEx05_2View::OnDraw(CDC* pDC)
{
CEx05_2Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CMenu *m_pMenu=AfxGetMainWnd()->GetMenu();
m_pMenu-> SetMenuItemBitmaps(ID_TEST_BMPMENU,MF_BYCOMMAND,&bitmap1,&bitmap2);
}
/////////////////////////////////////////////////////////////////////////////
// CEx05_2View printing
BOOL CEx05_2View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CEx05_2View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CEx05_2View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CEx05_2View diagnostics
#ifdef _DEBUG
void CEx05_2View::AssertValid() const
{
CView::AssertValid();
}
void CEx05_2View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CEx05_2Doc* CEx05_2View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx05_2Doc)));
return (CEx05_2Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CEx05_2View message handlers
void CEx05_2View::OnTestBmpmenu() //图标菜单消息函数
{
// TODO: Add your command handler code here
bCheck=!bCheck;
}
void CEx05_2View::OnUpdateTestBmpmenu(CCmdUI* pCmdUI) //更新图标菜单消息函数
{
// TODO: Add your command update UI handler code here
pCmdUI->SetCheck(!bCheck);
}
上一篇:
Ex05_2Doc.cpp
下一篇:
西班牙语医院科室名称