98 lines
2.1 KiB
C++
98 lines
2.1 KiB
C++
#pragma once
|
|
#include "resource.h"
|
|
#include "xlistctrl.h"
|
|
#include "simpleProperty.h"
|
|
|
|
class CQuickSelectDlg : public CDialog
|
|
{
|
|
DECLARE_DYNAMIC(CQuickSelectDlg)
|
|
|
|
public:
|
|
struct ItemData
|
|
{
|
|
enum Condition
|
|
{
|
|
eEqual = 0,
|
|
eNotEqual,
|
|
eCreator,
|
|
eCreatorEqual,
|
|
eLess,
|
|
eLessEqual,
|
|
eNone,
|
|
};
|
|
|
|
static CString getStringByCondition(const Condition &co);
|
|
static Condition getConditionByString(const CString &sCo);
|
|
|
|
bool m_bSelected;
|
|
Condition m_iCondition;
|
|
CString m_sValue;
|
|
CString m_sProperty;
|
|
|
|
ItemData(const Condition &condition
|
|
, const CString &property
|
|
, const CString &value
|
|
, bool bSelected )
|
|
: m_bSelected(bSelected)
|
|
, m_iCondition(condition)
|
|
, m_sValue(value)
|
|
, m_sProperty(property) { }
|
|
};
|
|
|
|
public:
|
|
CQuickSelectDlg(AcDbObjectId &idSelected, CWnd* pParent = NULL);
|
|
virtual ~CQuickSelectDlg();
|
|
|
|
enum { IDD = IDD_DLG_QUICK_SELECT };
|
|
|
|
protected:
|
|
virtual void DoDataExchange(CDataExchange* pDX);
|
|
virtual BOOL OnInitDialog();
|
|
|
|
void layoutControls(const int &cx, const int &cy);
|
|
void initColumns();
|
|
void resetWidthOfColumnHeader(const int &width);
|
|
void refreshList();
|
|
void clearList();
|
|
void getEntities(AcDbObjectIdArray &arr);
|
|
bool compareEntity(AcDbEntity *pEnt);
|
|
|
|
// type = 0 属性值是字符串,1 属性值是数字
|
|
CStringArray *makeConditionList(const SimpleProperty::PropertyType &type);
|
|
|
|
private:
|
|
DECLARE_MESSAGE_MAP()
|
|
afx_msg LONG_PTR onAcadKeepFocus( UINT_PTR, LONG_PTR);
|
|
afx_msg void OnBnClickedOk();
|
|
afx_msg void OnSize(UINT nType, int cx, int cy);
|
|
afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
|
|
afx_msg LRESULT OnComboSelection(WPARAM nItem, LPARAM nSubItem);
|
|
afx_msg LRESULT OnCheckBoxClicked(WPARAM, LPARAM);
|
|
public:
|
|
static void start();
|
|
|
|
private:
|
|
CXListCtrl m_wndList;
|
|
|
|
// 搜索类型 0 框选,1 全图
|
|
int m_iSearchType;
|
|
|
|
// 对话框的最小尺寸
|
|
CSize m_szMinDlgSize;
|
|
|
|
// 被选择的实体
|
|
AcDbObjectId m_idSelected;
|
|
|
|
// 实体的DXF名
|
|
CString m_sDXF;
|
|
|
|
// 实体的属性值
|
|
SimpleProperty::PropertySetByIndex m_srcProperty;
|
|
|
|
public:
|
|
// 选中的实体
|
|
AcDbObjectIdArray m_arids;
|
|
// 选择后是否直接修改属性
|
|
BOOL m_bDirectModify;
|
|
};
|