#pragma once #include "GroupLabel.h" #include typedef std::function 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); };