PictsViewer.h
上传用户:maryhy001
上传日期:2007-05-02
资源大小:2317k
文件大小:3k
- // PictsViewer.h : header file
- //
- #ifndef _PICTS_VIEWER_H
- #define _PICTS_VIEWER_H
- #include <afxtempl.h>
- #include "resource.h"
- #include "..publicBitmapStatic.h"
- #define UWM_PICTSVIEWERCLICKED WM_APP + 300
- #define UWM_PICTSVIEWERREFRESH WM_APP + 301
- typedef struct
- {
- RECT rc;
- DWORD lparam;
- }RCLINKIMG, *PRCLINKIMG;
- class CPictsGroup
- {
- friend class CPictsViewer;
- public:
- CPictsGroup();
- virtual ~CPictsGroup();
- void operator=(CPictsGroup &pgRight);
- void SetOwnerWnd(CWnd *pOwnerWnd);
- void SetCaption(LPCSTR strCaption);
- int SetImageList(CImageList &ilImages);
- void SetOnlyShowCaption(BOOL bEnable);
- int InsertImage(CBitmap &bmp, COLORREF crMask);
- void DeleteImage(const int index);
-
- protected:
- CWnd *m_pOwnerWnd;
- CString m_strCaption;
- CImageList m_imglstPicts;
- BOOL m_bOnlyShowCaption;
- };
- // CPictsViewer dialog
- class CPictsViewer : public CDialog
- {
- // Construction
- public:
- CPictsViewer(CWnd* pParent = NULL); // standard constructor
- BOOL Create(CWnd *pParent = NULL); // "Create" overrides.
- void SetOrgWindow(HWND hwnd);
- void SetColsPreRow(const int nColsPreRow);
- int InsertPictsGroup(CPictsGroup &pgPictsGroup);
- void DeletePictsGroup(const int index);
- BOOL PtInPictsExpandButtonRect(CPoint point, int &nGroupIndex, CRect &rcExpandButton);
- BOOL PtInPictsGroupCaptionRect(CPoint point, int &nPictsGroupIndex, CRect &rcCaption);
- BOOL GetCellFromPoint(CPoint point, int &nGroupIndex, int &nImageIndex, CRect &rcGraphic);
-
- // Dialog Data
- //{{AFX_DATA(CPictsViewer)
- enum { IDD = IDD_BMPVIEWERDLG };
- // NOTE: the ClassWizard will add data members here
- //}}AFX_DATA
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CPictsViewer)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- //}}AFX_VIRTUAL
- // Implementation
- protected:
- // Generated message map functions
- //{{AFX_MSG(CPictsViewer)
- afx_msg void OnPaint();
- afx_msg void OnDestroy();
- afx_msg void OnTimer(UINT nIDEvent);
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- afx_msg void OnKillFocus(CWnd* pNewWnd);
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- afx_msg void OnRefreshMsg(WPARAM wparam, LPARAM lparam);
- protected:
- void AdjustWindowRect(void);
- void FreeRcGralnkList(void);
- private:
- CWnd *m_wndParent;
- CPen m_pnPen;
- LOGPEN m_logpen;
- CFont m_ftFont;
- HCURSOR m_hcHand;
- HWND m_hOrgiWnd;
- UINT m_uColsPreRow;
- BOOL m_bHoverControl,
- m_bHoverGroupCaption;
- int m_nPictsGroupIndex,
- m_nImageListIndex;
- int m_nHoverGroupCaptionIndex;
-
- COLORREF m_crBkColor,
- m_crBrdColor;
- CRect m_rcUpScroll,
- m_rcDownScroll;
- CList<CPictsGroup*, CPictsGroup*&> m_lstPictsGroups;
- CList<PRCLINKIMG, PRCLINKIMG&> m_lstTxtRects,
- m_lstGraphicRects,
- m_lstExpandBtnRects;
- };
- #endif //!_PICTS_VIEWER_H