mylistctrl.h
上传用户:aiweisk
上传日期:2007-05-01
资源大小:85k
文件大小:3k
源码类别:

编辑器/阅读器

开发平台:

DOS

  1. //---------------------------------------------------------------------------------------
  2. // Quick Hex Shell extension
  3. // Copyright (c) 2000 by Shanker.C
  4. // All rights reserved
  5. // Author's consent required if this program is to be used for commercial purposes
  6. // No warranty of any kind, expressed or implied, is included with this
  7. // software; use at your own risk, responsibility for damages (if any) to
  8. // anyone resulting from the use of this software rests entirely with the user.
  9. // Please send comments/suggestions/criticisms to: Shanker@xlprint.com
  10. // March 7, 2000
  11. //--------------------------------------------------------------------------------
  12. #ifndef _MYLISTCTRL_H_
  13. #define _MYLISTCTRL_H_
  14. //--------------------------------------------------------------------------------
  15. #include <afxcmn.h>
  16. //--------------------------------------------------------------------------------
  17. #define COPY_COMMAND 50000
  18. //--------------------------------------------------------------------------------
  19. class CMyListCtrl : public CListCtrl
  20. {
  21. public:
  22. void LoadFile(CString strFile, int nFileSize);
  23. private:
  24. int m_nStartCol;
  25. int m_nStartRow;
  26. int m_nEndCol;
  27. int m_nEndRow;
  28. int m_TopRowStartCol;
  29. int m_TopRowEndCol;
  30. int m_BottRowStartCol;
  31. int m_BottRowEndCol;
  32. int m_StoreColX;
  33. int m_nTempEndRow;
  34. int m_cxChar;
  35. int m_nColWidth;
  36. int m_nTopRowCharStartIndex;
  37. int m_nTopRowCharEndIndex;
  38. int m_nBottRowCharStartIndex;
  39. int m_nBottRowCharEndIndex;
  40. int m_ASCIITopStartCol;
  41. int m_ASCIITopEndCol;
  42. int m_ASCIIBottStartCol;
  43. int m_ASCIIBottEndCol;
  44. int m_nStartRowStore;
  45. int m_nEndRowStore;
  46. int m_nFileSize;
  47. BOOL m_bLBTN;
  48. BOOL m_bLesser;
  49. CString m_strFile;
  50. FILE* m_fp;
  51. // White and selection brushes
  52. CBrush m_brush;
  53. CBrush m_whbrush;
  54. protected:
  55. // Helper functions
  56. void GetSelFromFile(char* szTemp, const int& nTempSize, 
  57. const int& nStartIndex, const int& nEndIndex, const int& nRow);
  58. void SetToDots(char* szLine);
  59. void Reset();
  60. protected:
  61. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  62. afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  63. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  64. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  65. afx_msg void DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct); 
  66. afx_msg void OnSize(UINT nType, int cx, int cy);
  67. virtual void PreSubclassWindow();
  68. DECLARE_MESSAGE_MAP()
  69. };
  70. //--------------------------------------------------------------------------------
  71. #endif //_MYLISTCTRL_H_
  72. //--------------------------------------------------------------------------------