doc_and_tools/tools/apps/hgjson/DlgRange.h

53 lines
1.1 KiB
C++

#pragma once
// CDlgRange 对话框
#include <string>
#include <vector>
#include <functional>
#define INIT_VAL_API_PROTO std::function<void(const wchar_t*, CComboBox*)>
class CDlgRange : public CDialogEx
{
DECLARE_DYNAMIC(CDlgRange)
INIT_VAL_API_PROTO init_val_api_;
std::wstring get_item_text(UINT id);
public:
CDlgRange(int type, CWnd* pParent = nullptr); // 标准构造函数
virtual ~CDlgRange();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_RANGE };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
virtual BOOL OnInitDialog();
DECLARE_MESSAGE_MAP()
public:
std::vector<std::wstring> vals_;
std::wstring init_;
enum {TYPE_RANGE, TYPE_LIST, TYPE_FIELDS};
int type_; // 0 - range; 1 - list; 2 - modify fields
void set_init_val_api(INIT_VAL_API_PROTO api)
{
init_val_api_ = api;
}
afx_msg void OnBnClickedButton1();
CListCtrl list_;
afx_msg void OnBnClickedOk();
afx_msg void OnNMDblclkList1(NMHDR* pNMHDR, LRESULT* pResult);
CComboBox val_;
afx_msg void OnCbnSelchangeComboField();
};