UseStatusView.cpp
资源名称:UseStatus.rar [点击查看]
上传用户:yafeite800
上传日期:2020-09-17
资源大小:36k
文件大小:3k
源码类别:
状态条
开发平台:
Visual C++
- // UseStatusView.cpp : implementation of the CUseStatusView class
- //
- #include "stdafx.h"
- #include "UseStatus.h"
- #include "MainFrm.h"
- #include "UseStatusDoc.h"
- #include "UseStatusView.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CUseStatusView
- IMPLEMENT_DYNCREATE(CUseStatusView, CView)
- BEGIN_MESSAGE_MAP(CUseStatusView, CView)
- //{{AFX_MSG_MAP(CUseStatusView)
- ON_WM_MOUSEMOVE()
- //}}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()
- /////////////////////////////////////////////////////////////////////////////
- // CUseStatusView construction/destruction
- CUseStatusView::CUseStatusView()
- {
- // TODO: add construction code here
- }
- CUseStatusView::~CUseStatusView()
- {
- }
- BOOL CUseStatusView::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- return CView::PreCreateWindow(cs);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CUseStatusView drawing
- void CUseStatusView::OnDraw(CDC* pDC)
- {
- CUseStatusDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- // TODO: add draw code for native data here
- }
- /////////////////////////////////////////////////////////////////////////////
- // CUseStatusView printing
- BOOL CUseStatusView::OnPreparePrinting(CPrintInfo* pInfo)
- {
- // default preparation
- return DoPreparePrinting(pInfo);
- }
- void CUseStatusView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add extra initialization before printing
- }
- void CUseStatusView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add cleanup after printing
- }
- /////////////////////////////////////////////////////////////////////////////
- // CUseStatusView diagnostics
- #ifdef _DEBUG
- void CUseStatusView::AssertValid() const
- {
- CView::AssertValid();
- }
- void CUseStatusView::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- CUseStatusDoc* CUseStatusView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CUseStatusDoc)));
- return (CUseStatusDoc*)m_pDocument;
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CUseStatusView message handlers
- void CUseStatusView::OnMouseMove(UINT nFlags, CPoint point)
- {
- CString str ;
- CMainFrame* pF = (CMainFrame*)AfxGetApp()->m_pMainWnd;
- CStatusBar* pS = &pF->m_wndStatusBar;
- if(pS)
- {
- str.Format("x : %d ; y : %d",point.x,point.y);
- pS->SetPaneText(0,str);
- }
- }