1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#if !defined(AFX_IMGLISTVIEW_H__C0DD00C1_EEA9_4E84_BB03_8DE83B2DEDEA__INCLUDED_)
#define AFX_IMGLISTVIEW_H__C0DD00C1_EEA9_4E84_BB03_8DE83B2DEDEA__INCLUDED_
 
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ImgListView.h : header file
//
 
/////////////////////////////////////////////////////////////////////////////
// CImgListView view
#include <map>
using std::map;
 
 
#define        LEFT_MARJIN     15
#define        TOP_MARJIN     15
#define        ITEM_WIDTH     190 // 380      // °ªÀÌ ¹Ù²î¾î¾ß ÇϹǷΠdefineÀ̳ª const´Â ¾î¿ï¸®Áö ¾Ê´Â´Ù.
#define        ITEM_HEIGHT     160 // 320      // 
#define        ITEM_TEXT    22            // ¾ÆÀÌÅÛ¿¡ ´ëÇÑ ±ÛÀÚ ³ôÀÌ
#define        ITEM_ROW_MARJIN    15        // ¾ÆÀÌÅÛ°ú ¾ÆÀÌÅÛÀÇ °¡·Î»çÀÌ
#define        ITEM_COL_MARJIN     20        // ¾ÆÀÌÅÛ°ú ¾ÆÀÌÅÛÀÇ ¼¼·Î»çÀÌ
 
class CPotoItem  
{
public:
    CPotoItem();
    CPotoItem(CString strFilePath);
    CPotoItem(CString strFilePath,CString strFileName,CString strImgInfo =_T(""));
    virtual ~CPotoItem();
public:
    void GetItemRect(int nItem);
    void DrawRect(CDC *pDC, COLORREF color,CRect rc);
    void DrawText(CDC* pDC, COLORREF color );
    void Draw(CDC* pDC, CRect rcClient, CRect rcChange );
 
    CImage  m_Img;
    CRect    m_rcImg;
    BOOL    m_bSelect;     // ¼±ÅàµÇ¾ú´Â°¡ 
    BOOL    m_bValid;      // °´Ã¼ÀÇ Á¸À缺 
    BOOL    m_bProcesing;  // Ã³¸®ÁßÀΰ¡ 
    TCHAR   m_Path[MAX_PATH];
 
    CRect   GetRect()                 { return m_rcImg; }
    void    SetSelect( bool bState ) { m_bSelect = bState; }
    void    ToggleSelected()         { m_bSelect = !m_bSelect;}
};
 
 
typedef map<CString,CPotoItem*> IMG_MAP;
 
#define    KEY_DOWN(VK_CODE) ((GetAsyncKeyState(VK_CODE) & 0x8000) ? 1 : 0)
 
#define    UM_CLK_ITEM_UPDATE    WM_USER    + 102
class CImgListView : public CScrollView
{
protected:
    CImgListView();           // protected constructor used by dynamic creation
    DECLARE_DYNCREATE(CImgListView)
 
    // Attributes
public:
 
    // Operations
public:
 
    // Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CImgListView)
protected:
    virtual void OnDraw(CDC* pDC);      // overridden to draw this view
    virtual void OnInitialUpdate();     // first time after construct
    //}}AFX_VIRTUAL
 
    // Implementation
protected:
    virtual ~CImgListView();
#ifdef _DEBUG
    virtual void AssertValid() const;
    virtual void Dump(CDumpContext& dc) const;
#endif
 
    // Generated message map functions
    //{{AFX_MSG(CImgListView)
    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnPaint();
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
 
public:
    IMG_MAP            m_ImgMap;
    int                m_nHItem;        // ¼¼·Î·Î ¸î°³°¡ Ãâ·ÂÀÌ µÉ°ÍÀΰ¡?
    int                m_nHItemOld;
    int                m_nAddItem;        // ÀоîµéÀΠ¾ÆÀÌÅÛÀÇ ÃѰ¹¼ö
    CBrush            m_BgBrush;        // ¹è°æBrush
    CImage*            m_pSelImg;
    CPotoItem        *m_pSelectItem;
public:
    CImage*    GetSelImg() const       {return m_pSelImg;};
    void    DeleteItemAll();
    BYTE*    GetImagePoint(); 
    TCHAR*    GetSelectImgPath();
 
    BOOL SelectItemChk(CPoint point);
    BOOL  LoadImageFolder(CString strPath, CString strGlassID, CString strOp = _T(""));
    BOOL  LoadImage(CString strFilePath);
 
    void  SetPageSize();
    void  UpdateItem();
    CRect GetItemRect(int nItem);
 
    void UpdateView();
public:
    afx_msg BOOL OnEraseBkgnd(CDC* pDC);
    afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
    afx_msg void OnDestroy();
};
 
/////////////////////////////////////////////////////////////////////////////
 
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
 
#endif // !defined(AFX_IMGLISTVIEW_H__C0DD00C1_EEA9_4E84_BB03_8DE83B2DEDEA__INCLUDED_)