ex63View.cpp
资源名称:VC6.0.rar [点击查看]
上传用户:qdhmjx
上传日期:2022-07-11
资源大小:2226k
文件大小:3k
源码类别:
书籍源码
开发平台:
Visual C++
- // ex63View.cpp : implementation of the CEx63View class
- //
- #include "stdafx.h"
- #include "ex63.h"
- #include "ex63Doc.h"
- #include "ex63View.h"
- #include "MainFrm.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CEx63View
- IMPLEMENT_DYNCREATE(CEx63View, CView)
- BEGIN_MESSAGE_MAP(CEx63View, CView)
- //{{AFX_MSG_MAP(CEx63View)
- ON_WM_MOUSEMOVE()
- ON_UPDATE_COMMAND_UI(ID_INDICATOR_CTRL, OnUpdateKeyCtrl)
- //}}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()
- /////////////////////////////////////////////////////////////////////////////
- // CEx63View construction/destruction
- CEx63View::CEx63View()
- {
- // TODO: add construction code here
- }
- CEx63View::~CEx63View()
- {
- }
- BOOL CEx63View::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- return CView::PreCreateWindow(cs);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx63View drawing
- void CEx63View::OnDraw(CDC* pDC)
- {
- CEx63Doc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- // TODO: add draw code for native data here
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx63View printing
- BOOL CEx63View::OnPreparePrinting(CPrintInfo* pInfo)
- {
- // default preparation
- return DoPreparePrinting(pInfo);
- }
- void CEx63View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add extra initialization before printing
- }
- void CEx63View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add cleanup after printing
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx63View diagnostics
- #ifdef _DEBUG
- void CEx63View::AssertValid() const
- {
- CView::AssertValid();
- }
- void CEx63View::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- CEx63Doc* CEx63View::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx63Doc)));
- return (CEx63Doc*)m_pDocument;
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CEx63View message handlers
- void CEx63View::OnMouseMove(UINT nFlags, CPoint point)
- {
- CString str;
- str.Format("x=%d,y=%d",point.x,point.y) ;
- CMainFrame* pMainFrame=(CMainFrame*)(AfxGetApp()->GetMainWnd());
- pMainFrame->m_wndStatusBar.SetPaneStyle(1,SBPS_POPOUT);
- pMainFrame->m_wndStatusBar. SetPaneText(1,str) ;
- CView::OnMouseMove(nFlags, point);
- }
- void CEx63View::OnUpdateKeyCtrl(CCmdUI* pCmdUI)
- {
- pCmdUI->Enable(::GetKeyState(VK_CONTROL)<0);
- }