#pragma once // CDlgCondition 对话框 #include #include #include class CDlgCondition : public CDialogEx { DECLARE_DYNAMIC(CDlgCondition) std::wstring condition_; std::wstring name_; CComboBox items_; CComboBox oper_; CComboBox value_; CComboBox value2_; std::function < std::wstring(const wchar_t*/*name*/, int/*index*/)> item_val_; std::function item_all_; std::wstring get_item_text(UINT id); std::wstring get_value(int range, bool first); void enable_value_controls(bool enable, int range, bool second = true); void clear_items(void); typedef struct _opt_item { std::wstring name; std::wstring title; int range; int type; }OPTITEM, *LPOPTITEM; public: CDlgCondition(const wchar_t* name, CWnd* pParent = nullptr); // 标准构造函数 virtual ~CDlgCondition(); // 对话框数据 #ifdef AFX_DESIGN_TIME enum { IDD = IDD_CONDITION }; #endif protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 virtual BOOL OnInitDialog(); DECLARE_MESSAGE_MAP() public: void init_data(std::function item, std::function < std::wstring(const wchar_t*/*name*/, int/*index*/)> value, const wchar_t* data0); std::wstring get_condition(void); afx_msg void OnBnClickedOk(); afx_msg void OnBnClickedButton1(); afx_msg void OnBnClickedCancel(); afx_msg void OnCbnSelchangeComboItem(); afx_msg void OnCbnSelchangeComboLogic(); };