PictsViewer.h
上传用户:maryhy001
上传日期:2007-05-02
资源大小:2317k
文件大小:3k
源码类别:

网格计算

开发平台:

Visual C++

  1. // PictsViewer.h : header file
  2. //
  3. #ifndef _PICTS_VIEWER_H
  4. #define _PICTS_VIEWER_H
  5. #include <afxtempl.h>
  6. #include "resource.h"
  7. #include "..publicBitmapStatic.h"
  8. #define UWM_PICTSVIEWERCLICKED WM_APP + 300
  9. #define UWM_PICTSVIEWERREFRESH WM_APP + 301
  10. typedef struct
  11. {
  12. RECT rc;
  13. DWORD lparam;
  14. }RCLINKIMG, *PRCLINKIMG;
  15. class CPictsGroup
  16. {
  17. friend class CPictsViewer;
  18. public:
  19. CPictsGroup();
  20. virtual ~CPictsGroup();
  21. void operator=(CPictsGroup &pgRight);
  22. void SetOwnerWnd(CWnd *pOwnerWnd);
  23. void SetCaption(LPCSTR strCaption);
  24. int  SetImageList(CImageList &ilImages);
  25. void SetOnlyShowCaption(BOOL bEnable);
  26. int  InsertImage(CBitmap &bmp, COLORREF crMask);
  27. void DeleteImage(const int index);
  28. protected:
  29. CWnd *m_pOwnerWnd;
  30. CString m_strCaption;
  31. CImageList m_imglstPicts;
  32. BOOL m_bOnlyShowCaption;
  33. };
  34. // CPictsViewer dialog
  35. class CPictsViewer : public CDialog
  36. {
  37. // Construction
  38. public:
  39. CPictsViewer(CWnd* pParent = NULL);   // standard constructor
  40. BOOL Create(CWnd *pParent = NULL);   // "Create" overrides.
  41. void SetOrgWindow(HWND hwnd);
  42. void SetColsPreRow(const int nColsPreRow);
  43. int  InsertPictsGroup(CPictsGroup &pgPictsGroup);
  44. void DeletePictsGroup(const int index);
  45. BOOL PtInPictsExpandButtonRect(CPoint point, int &nGroupIndex, CRect &rcExpandButton);
  46. BOOL PtInPictsGroupCaptionRect(CPoint point, int &nPictsGroupIndex, CRect &rcCaption);
  47. BOOL GetCellFromPoint(CPoint point, int &nGroupIndex, int &nImageIndex, CRect &rcGraphic);
  48. // Dialog Data
  49. //{{AFX_DATA(CPictsViewer)
  50. enum { IDD = IDD_BMPVIEWERDLG };
  51. // NOTE: the ClassWizard will add data members here
  52. //}}AFX_DATA
  53. // Overrides
  54. // ClassWizard generated virtual function overrides
  55. //{{AFX_VIRTUAL(CPictsViewer)
  56. protected:
  57. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  58. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  59. //}}AFX_VIRTUAL
  60. // Implementation
  61. protected:
  62. // Generated message map functions
  63. //{{AFX_MSG(CPictsViewer)
  64. afx_msg void OnPaint();
  65. afx_msg void OnDestroy();
  66. afx_msg void OnTimer(UINT nIDEvent);
  67. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  68. afx_msg void OnKillFocus(CWnd* pNewWnd);
  69. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  70. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  71. afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  72. //}}AFX_MSG
  73. DECLARE_MESSAGE_MAP()
  74. afx_msg void OnRefreshMsg(WPARAM wparam, LPARAM lparam);
  75. protected:
  76. void AdjustWindowRect(void);
  77. void FreeRcGralnkList(void);
  78. private:
  79. CWnd *m_wndParent;
  80. CPen m_pnPen;
  81. LOGPEN m_logpen;
  82. CFont m_ftFont;
  83. HCURSOR m_hcHand;
  84. HWND m_hOrgiWnd;
  85. UINT m_uColsPreRow;
  86. BOOL m_bHoverControl,
  87. m_bHoverGroupCaption;
  88. int m_nPictsGroupIndex,
  89. m_nImageListIndex;
  90. int m_nHoverGroupCaptionIndex;
  91. COLORREF m_crBkColor,
  92. m_crBrdColor;
  93. CRect m_rcUpScroll,
  94. m_rcDownScroll;
  95. CList<CPictsGroup*, CPictsGroup*&> m_lstPictsGroups;
  96. CList<PRCLINKIMG, PRCLINKIMG&> m_lstTxtRects, 
  97. m_lstGraphicRects,
  98. m_lstExpandBtnRects;
  99. };
  100. #endif //!_PICTS_VIEWER_H