LAPTOP-SNT8I5JK\Boounion
2025-06-19 c23460022397da62e4d77c90ca3a65f498c1d0c9
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
#if !defined(AFX_HEADCTRL_H__E483AE98_F737_4DBF_8508_8E934A8F6988__INCLUDED_)
#define AFX_HEADCTRL_H__E483AE98_F737_4DBF_8508_8E934A8F6988__INCLUDED_
 
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// HeadCtrl.h : header file
//
 
/////////////////////////////////////////////////////////////////////////////
// CHeadCtrl window
#ifndef __AFXTEMPL_H
#include <afxtempl.h>
#endif
 
class CHeadCtrl : public CHeaderCtrl
{
// Construction
public:
    struct HEADCELL
    {
        DWORD   state;
        CString string;
    };
    class CHeadCell : public HEADCELL
    {
    public:
        CHeadCell()
        {
            state=0;
            string="";
        }
        CHeadCell(HEADCELL& hcell)
        {
            *this=hcell;
        }
        CHeadCell operator=(HEADCELL& hcell)
        {
            state=hcell.state;
            string=hcell.string;
            return *this;
        }
    };
 
    typedef CArray<CHeadCell,CHeadCell&> CHeadItem;
    typedef CArray<CHeadItem,CHeadItem&> CHeadInfo;
 
public:
    CHeadCtrl();
    void SetCount(int nCount, CFont* pFont);
    int  GetCount(){return m_count;}
    int  GetHeadHeight();
 
 
    void InsertColumn(int nCol);
    void DeleteColumn(int nCol);
    void FontChange(LOGFONT logfont);
    BOOL SetItemText(int nItem, int nSubItem, LPCSTR lpcstr);
    CString GetItemText(int nItem, int nSubItem);
    BOOL SetItemMerge(int nsItem, int nsSubItem, int neItem, int neSubItem); 
    UINT GetItemState(int nItem, int nSubItem, int& down, int& right);
    BOOL GetRect(int nItem, int nSubItem, CRect& rect);
protected:
    BOOL m_bclick;
    CPoint m_pnt;
 
    CFont m_font;
    int m_count;
    CHeadInfo m_Info;
    BOOL IsDraw(CRect rect);
    BOOL GetTextRect(CDC* pDC, CString strText, CRect& rect);
 
// Attributes
public:
 
// Operations
public:
 
// Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CHeadCtrl)
    virtual void OnPaint();
    //}}AFX_VIRTUAL
 
// Implementation
public:
    virtual ~CHeadCtrl();
 
    // Generated message map functions
protected:
    //{{AFX_MSG(CHeadCtrl)
    afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
    //}}AFX_MSG
 
    DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
 
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
 
#endif // !defined(AFX_HEADCTRL_H__E483AE98_F737_4DBF_8508_8E934A8F6988__INCLUDED_)