【VC开源代码栏目提醒】:网学会员为需要VC开源代码的朋友们搜集整理了Ex05_1View.cpp相关资料,希望对各位网友有所帮助!
// Ex05_1View.cpp : implementation of the CEx05_1View class
//
#include "stdafx.h"
#include "Ex05_1.h"
#include "Ex05_1Doc.h"
#include "Ex05_1View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CEx05_1View
IMPLEMENT_DYNCREATE(CEx05_1View, CView)
BEGIN_MESSAGE_MAP(CEx05_1View, CView)
//{{AFX_MSG_MAP(CEx05_1View)
ON_COMMAND(ID_TEST_MESSAGEDLG1, OnTestMessagedlg1)
ON_COMMAND(ID_TEST_MESSAGEDLG2, OnTestMessagedlg2)
ON_COMMAND(ID_TEST_CONNECT, OnTestConnect)
ON_COMMAND(ID_TEST_BREAK, OnTestBreak)
ON_UPDATE_COMMAND_UI(ID_TEST_CONNECT, OnUpdateTestConnect)
ON_UPDATE_COMMAND_UI(ID_TEST_BREAK, OnUpdateTestBreak)
ON_COMMAND(ID_VIEW_L, OnViewL)
//}}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_1View construction/destruction
CEx05_1View::CEx05_1View()
{
// TODO: add construction code here
bCheck=1;
bEnable=1;
}
CEx05_1View::~CEx05_1View()
{
}
BOOL CEx05_1View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CEx05_1View drawing
void CEx05_1View::OnDraw(CDC* pDC)
{
CEx05_1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CEx05_1View printing
BOOL CEx05_1View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CEx05_1View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CEx05_1View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CEx05_1View diagnostics
#ifdef _DEBUG
void CEx05_1View::AssertValid() const
{
CView::AssertValid();
}
void CEx05_1View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CEx05_1Doc* CEx05_1View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx05_1Doc)));
return (CEx05_1Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CEx05_1View message handlers
//////////////////点击菜单/////////////////////
void CEx05_1View::OnTestMessagedlg1() //点击消息对话框1菜单的消息函数
{
// TODO: Add your command handler code here
AfxMessageBox("这是消息对话框1!");
}
void CEx05_1View::OnTestMessagedlg2() //点击消息对话框2菜单的消息函数
{
// TODO: Add your command handler code here
AfxMessageBox("这是消息对话框2!");
}
void CEx05_1View::OnTestConnect() //点击连接菜单的消息函数
{
// TODO: Add your command handler code here
bCheck=1;
bEnable=1;
}
void CEx05_1View::OnTestBreak() //点击断开菜单的消息函数
{
// TODO: Add your command handler code here
bCheck=0;
bEnable=0;
}
/////////////////////////菜单更新/////////////////////////////
void CEx05_1View::OnUpdateTestConnect(CCmdUI* pCmdUI) //更新连接菜单
{
// TODO: Add your command update UI handler code here
pCmdUI->SetCheck(bCheck);//打勾或不打勾
pCmdUI->Enable(!bEnable);//禁用或启用
}
void CEx05_1View::OnUpdateTestBreak(CCmdUI* pCmdUI) //更新断开菜单
{
// TODO: Add your command update UI handler code here
pCmdUI->SetCheck(!bCheck);//打勾或不打勾
pCmdUI->Enable(bEnable);//禁用或启用
}
void CEx05_1View::OnViewL()
{
// TODO: Add your command handler code here
}
上一篇:
Ex05_1Doc.cpp
下一篇:
科研管理杂志简介