hexviewView.h
Upload User: ycdyang2
Upload Date: 2007-01-07
Package Size: 126k
Code Size: 3k
Category:

Editor

Development Platform:

Visual C++

  1. /* ---------------------------------------------------------------------------
  2.    This code can be used as you wish but without warranties as to performance 
  3.    of merchantability or any other warranties whether expressed or implied.
  4.    
  5.  Written by Mike Funduc, Funduc Software Inc. 8/1/96
  6.  To download the code and more useful utilities (including Search and
  7.  Replace for Windows 95/NT, 3.1x) go to:
  8.  http://www.funduc.com
  9. ----------------------------------------------------------------------------*/
  10. // hexviewView.h : interface of the CHexviewView class
  11. //
  12. /////////////////////////////////////////////////////////////////////////////
  13. class CHexviewView : public CScrollView
  14. {
  15. protected: // create from serialization only
  16. CHexviewView();
  17. DECLARE_DYNCREATE(CHexviewView)
  18. // Attributes
  19. public:
  20. void UpdateScrollSizes();
  21. CHexviewDoc* GetDocument();
  22. // Operations
  23. public:
  24. // Overrides
  25. // ClassWizard generated virtual function overrides
  26. //{{AFX_VIRTUAL(CHexviewView)
  27. public:
  28. virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  29. virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
  30. protected:
  31. virtual void OnInitialUpdate(); // called first time after construct
  32. virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  33. virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  34. virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  35. virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
  36. //}}AFX_VIRTUAL
  37. // Implementation
  38. public:
  39. virtual ~CHexviewView();
  40. void DispData(CDC* pDC, int iFirstLine, int iTotalLines, CFont *cfFixedFont,
  41. CFont *cfBoldFont, 
  42. int iWndLines, int iFontHeight, int iCurrentOffset,
  43. int iFontWidth, int iLine = 0);
  44. #ifdef _DEBUG
  45. virtual void AssertValid() const;
  46. virtual void Dump(CDumpContext& dc) const;
  47. #endif
  48. private:
  49.     CFont *m_cfFixedFont;
  50.     CFont *m_cfBoldFont;
  51.     CFont *m_cfPrintFont;
  52.     CFont *m_cfPrintBoldFont;
  53.     int m_iFontWidth;
  54.     int m_iFontHeight;
  55.     int m_iFirstLine;
  56.     int m_iLastLine;
  57.     int m_iWndLines;
  58. int m_iViewHeight;
  59. int m_iCurrentOffset;
  60. CString m_strTimePrint;
  61. protected:
  62. // Generated message map functions
  63. protected:
  64. //{{AFX_MSG(CHexviewView)
  65. afx_msg void OnDestroy();
  66. afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  67. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  68. afx_msg void OnSize(UINT nType, int cx, int cy);
  69. afx_msg void OnViewNextblock();
  70. afx_msg void OnViewPreviousblock();
  71. afx_msg void OnUpdateViewNextblock(CCmdUI* pCmdUI);
  72. afx_msg void OnUpdateViewPreviousblock(CCmdUI* pCmdUI);
  73. afx_msg void OnViewGoto();
  74. //}}AFX_MSG
  75. DECLARE_MESSAGE_MAP()
  76. };
  77. #ifndef _DEBUG  // debug version in hexviewView.cpp
  78. inline CHexviewDoc* CHexviewView::GetDocument()
  79.    { return (CHexviewDoc*)m_pDocument; }
  80. #endif
  81. /////////////////////////////////////////////////////////////////////////////