chenluhua1980
2026-01-24 8fc148424accf484b4f331c7d5fb11eb7383cf89
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
#pragma once
#include "GroupLabel.h"
#include <functional>
 
 
typedef std::function<void(void* pFrom, int code, void* pContext, int contextType)> ONCONTENTCHANGED;
 
 
// CPjPage1 对话框
 
class CCjPageBase : public CDialogEx
{
    DECLARE_DYNAMIC(CCjPageBase)
 
public:
    CCjPageBase(UINT nID, CWnd* pPage);            // 标准构造函数
    virtual ~CCjPageBase();
 
public:
    void SetTitle(CString strTitle);
    virtual int OnApply() { return 0; };
    void SetOnContentChanged(ONCONTENTCHANGED onContentChanged);
    void SetContext(void* pContext, int type);
    void* GetContext();
 
protected:
    virtual void Resize();
    virtual void ContentChanged(int code);
    virtual void OnSetContext(void* pContext) { };
 
private:
    COLORREF m_crBkgndCached;
    CBrush m_brBkgnd;
    CGroupLabel m_labelTitle;
    ONCONTENTCHANGED m_onContentChanged;
 
protected:
    COLORREF m_crBkgnd;
    BOOL m_bContentChangedLock;
    void* m_pContext;
    int m_nContextType;
 
// 对话框数据
#ifdef AFX_DESIGN_TIME
    enum { IDD = IDD_CJ_PAGE1 };
#endif
 
protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持
 
    DECLARE_MESSAGE_MAP()
public:
    virtual BOOL OnInitDialog();
    afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
    afx_msg void OnSize(UINT nType, int cx, int cy);
};